Hi,
This should have been easy but I don't know what I am missing here.
I have to join tables like this:
table 1:
empid empname mngrid
emp1 emp1name mn1
emp2 emp2name mn1
emp3 emp3name mn1
table 2:
empid mngrid score
emp1 mn1 3
emp2 mn1 2
I need rows from table 1 which are present in table 2 and also which are not based on condition as:
empname, score
emp1name, 3
emp2name, 2
emp3name, null
What I have tried:
SELECT EMPNAME, SCORE
FROM TABLE1 UD, TABLE2 US
WHERE UD.MNGRID=US.MNGRID
AND US.MNGRID='mn1'
but this has duplicate data.