Can someone help me to figure out a query for this requirement? I have a table with the follwoign columns:
ID Agency Value
1 A 1000
1 B 2000
1 C 3000
2 A 1100
2 C 3100
3 B 2200
3 C 3200
Now i want to be able to retrieve so that if for an ID the Agency A and B are pr esent then i want to take the row of A else if onyl A is present then A else if only B is present then B. Can i do this in one query?
ID Agency Value
1 A 1000
1 B 2000
1 C 3000
2 A 1100
2 C 3100
3 B 2200
3 C 3200
Now i want to be able to retrieve so that if for an ID the Agency A and B are pr esent then i want to take the row of A else if onyl A is present then A else if only B is present then B. Can i do this in one query?
Comment