I am having a table which has IP Addresses and User names. A GUI has been developed to select these values. IP Address is a selection field from which we can select multiple ip addresses and the username field is a dropdown from which we can select only one username.
The table contains combinations of IP addresses and usernames but when user selects multiple IP addresses the username dropdown should only be populated with the usernames which are common in the selected multiple IP Addresses. Is there any way to write SQL for it or i have to go with a PL/SQL approach or a programming approach.
PS: i am using db2 database
This is another query that you can use