This should be simple but no matter what I try I can t get the data I want... I have two tables:
<><>独立>
empID relID dob
100 1 8/8/1988
100 2 1/1/2001
200 1 9/9/1989
<>employee e
empID
100
200
300
我需要加入:
<>Desired Results(只有带有rel=1的 do)
e.empID d.dob
100 8/8/1988
200 9/9/1989
300 NULL
不管是否与我一起使用,我最后只拿到相互交错的记录(如果受扶养的职工会有记录,有手提=1)。
www.un.org/Depts/DGACM/index_french.htm
e.empID d.dob
100 8/8/1988
200 9/9/1989
SELECT e.empID, d.dob
FROM employee AS e LEFT OUTER JOIN dependent AS d ON e.empID = d.empID
WHERE (d.relID = 1)
我失踪/错是什么?
感谢您的热情关注!