View Single Post
  #2 (permalink)  
Old January 28th, 2008, 11:55 AM
joefawcett's Avatar
joefawcett joefawcett is offline
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

I think you need a union of a left join and a right join:
Code:
SELECT * FROM #JobListTable JL
LEFT OUTER JOIN #SequentialJobListTable SJL
ON JL.job_date = SJL.job_date AND
JL.job_number = SJL.job_number AND
JL.job_phase = SJL.job_phase

UNION

SELECT * FROM #JobListTable JL
RIGHT OUTER JOIN #SequentialJobListTable SJL
ON JL.job_date = SJL.job_date AND
JL.job_number = SJL.job_number AND
JL.job_phase = SJL.job_phase
although you haven't stated exactly what results you need so it's hard to say.

--

Joe (Microsoft MVP - XML)