List:General Discussion« Previous MessageNext Message »
From:Joshua J.Kugler Date:April 24 2003 7:30pm
Subject:Re: Can I do two LEFT JOINs in one SELECT?
View as plain text  
On Wednesday 23 April 2003 18:11, Daevid Vincent wrote:
> I've tried a few things with different results, but it seems I need to do a
> double LEFT JOIN. Perhaps I just don't know the syntax, or perhaps this
> isn't implemented, or perhaps I just am doing this Query wrong...

You can do as many left joins as you want.  Example:


SELECT leg_activity.activity_date, leg_transitions.trans_desc, 
leg_text.leg_version, body_list.body_name
FROM leg_activity LEFT JOIN leg_comm_hist ON leg_activity.id = 
leg_comm_hist.leg_activity_id
LEFT JOIN  body_list ON leg_comm_hist.body_list_id = body_list.id
LEFT JOIN leg_version_hist ON leg_activity.id = 
leg_version_hist.leg_activity_id
LEFT JOIN leg_text ON leg_version_hist.leg_text_id = leg_text.id
LEFT JOIN leg_transitions ON leg_activity.transition_id = leg_transitions.id
WHERE leg_activity.leg_header_id = 7

Have fun!


-- 
Joshua Kugler, Information Services Director
Associated Students of the University of Alaska Fairbanks
isd@stripped, 907-474-7601
Thread
Can I do two LEFT JOINs in one SELECT?Daevid Vincent24 Apr
  • RE: Can I do two LEFT JOINs in one SELECT?Uttam24 Apr
    • RE: INNER JOIN? Was: Can I do two LEFT JOINs in one SELECT?Daevid Vincent24 Apr
  • Re: Can I do two LEFT JOINs in one SELECT?Brent Baisley24 Apr
  • Re: Can I do two LEFT JOINs in one SELECT?Joshua J . Kugler24 Apr
RE: INNER JOIN? Was: Can I do two LEFT JOINs in one SELECT?Uttam25 Apr