My table is look like this:
Sub_Package_ID Package_ID Destination_ID Sub_Destionation_ID
-------------------- -------------------- -------------------- --------------------
1 1 1 5
2 1 2 8
3 1 2 9
4 2 1 6
5 2 2 7
6 3 1 5
7 3 2 7
8 4 1 5
9 4 2 8
10 4 2 9
11 4 2 7
I want to write a query in that way if i enter (6,7) as Sub_Destionation_ID query will return (2) as Package_ID, if i enter (5,7) as Sub_Destionation_ID query will return (3) as Package_ID
if there is no such Package_ID exists as per user input such as
if i enter (6,9) as Sub_Destionation_ID query will return nothing as Package_ID,
if i enter (8,5) as Sub_Destionation_ID query will return nothing as Package_ID,
if i enter (8,9) as Sub_Destionation_ID query will return nothing as Package_ID,
if i enter (8,7) as Sub_Destionation_ID query will return nothing as Package_ID.
Hope i can explain my question; if there is any query please ask.
Please help me to solve this query.
Thanks in advance.