Julian Hansen Julian Hansen - 1 year ago 100
SQL Question

List names of directors

SELECT DISTINCT director.lastname, director.firstname
FROM director LEFT JOIN movdir ON director.dirnum = movdir.dirnum

This is what I have right now, but I have to look at a
table and see if
dirnum(director number)
only shows up once. If it does, I have to go to the
table and see what their name is by looking at
and see whose name is attached to that number.

Answer Source

You could use GROUP BY with HAVING-clause:

SELECT director.lastname, director.firstname
FROM director 
INNER JOIN movdir ON director.dirnum = movdir.dirnum
GROUP BY director.lastname, director.firstname
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download