Topic: SQL Query in ComboBox referring to another Combobox Result
Hi everybody,
I am in trouble trying to assign an SQL Query to a Combobox using the choice of another Combobox.
I have 2 tables
Ports Switches
id | id_Switches | Ports | id_VLANS | id_Status id | Hostname | etc....
1 | 1 | Gi1/0/1 | 1 | 1 1 | Hostname1 |
2 | 1 | Gi1/0/2 | 6 | 1 2 | Hostname2 |
3 | 1 | Gi1/0/3 | 4 | 2 3 | Hostname3 |
In Combobox 1, I choose the switch Hostname and in Combobox, I would like to be able to choose only 1 port for filtering
How could I do this without entering thousands of entries in a new column in Ports?
The proper SQL Query should be :
select p.ports,p.id
from switches s
left join ports p on s.id=p.id_Switches
where s.id=+Choice of Combobox 1+