Id C1 C2

1 A A1

2 B B1

3 A A2

4 A A

5 B B3

6 B B4

If I give the ID value, I have to show the equaling C2 value

condition 1. if C2= C1 then I have to get all C2 values where C2=C1

eg. id= 4, out put is A, A1, A2

id = 5 , output is B3

id= 1, out put is A1

Thanks in Advance.