sushil_ach
New User
Joined: 01 May 2006 Posts: 6
|
|
|
|
Hi! friends..
I got two tables say, 'A' and B'.
'A' has column BIN , REGN and QUES.
Let the values be..
BIN QUES REGN
---- ------- -------
1111 Y 1
2222 N 2
3333 N 1
4444 Y 1
'B' has column BIN and QUES
Let the values be..
BIN QUES REGN
---- ------- --------
1111 N 1
2222 N 2
3333 Y 1
5555 N 2
I want to find how many Y's and N's are there for QUES in Table 'A', also if the BIN is not found in 'A' the query should fetch the BIN from table 'B'.
In my query i'm using COUNT(*) and UNION which is getting the duplicates which i dont want
Answer for the above example should be like....
REGN QUES
-------- --------
1 N 2
1 Y 1
2 N 2 |
|