Date: 04/18/07 (SQL Server) Keywords: sql I have a multiple-table query that will involve either a left or right join, but am not sure how to approach this. SELECT p.* pj.job, ps.skill FROM PERSON p INNER JOIN PERSON_SKILL ps on ps.pid = p.id INNER JOIN SKILL s ON s.id = ps.sid INNER JOIN PERSON_JOBS pj ON j.pid = p.id In this case I've had multiple of the same records (in this case, from PERSON) returned because of the possibility of more than 1 record (or none, possibly) from PERSON_SKILL being returned. Is this where a left or right join comes into play? *Edited last line of SQL* Source: http://community.livejournal.com/sqlserver/57623.html
|