sanjayjs
asked on
Haw to apply join on 2 tables with this scenario
Table a contains
rno subjectcode
1 a
1 b
1 c
1 d
2 a
2 b
2 c
2 d
Now table b contains
rno subjectcode
1 c
2 b
2 d
I want to fetch the subjectcodes for every uid missing from table b. But which exists in table a.
conta
rno subjectcode
1 a
1 b
1 c
1 d
2 a
2 b
2 c
2 d
Now table b contains
rno subjectcode
1 c
2 b
2 d
I want to fetch the subjectcodes for every uid missing from table b. But which exists in table a.
conta
or this...
SELECT a.* FROM TABLEA a
LEFT JOIN TABLEB on a.rno = b.rno and a.subjectcode = b.subjectcode
WHERE b.rno IS NULL
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ok
SELECT rno subjectcode FROM TABLEA
EXCEPT
SELECT rno subjectcode FROM TABLEB