I have one table which contains two columns namely ID and STATUS. If one ID has two STATUS value, then we should take one specific STATUS value from the two. How can I achieve that?
TABLE A:
ID STATUS
1 P
1 S
2 P
2 C
3 C
4 D
5 P
If P or S then display P
If P or C then display P
The ID 1 has two STATUS values P and S
So, it should be P
The ID 2 has STATUS values P and C. So it should be P
Remaining IDs are unique. So display the corresponding actual STATUS values.
Thanks to all.
I used inner join the table on ID column and STATUS.
But I am getting all the STATUS values as P for all IDs.