[vox-tech] SQL question (mysql)

dylan vox-tech@lists.lugod.org
Fri, 02 Apr 2004 13:06:32 -0800


on 04.4.1 1:32 AM, David Hummel at ddhummel@pacbell.net was reported to have
writen:

> 
> If I understand your table structure correctly, here's another version:
> 
> select volunteer_info.*
> from assignment_data
> inner join volunteer_info using (user_id)
> where assignment_data.event_id = $event_id
> 

this worked fine...

> 
> Then left join score_board onto the previous query:
> 
> select volunteer_info.*
> from assignment_data
> inner join volunteer_info using (user_id)
> left join score_board using (user_id,event_id)
> where assignment_data.event_id = $event_id
> 
> This way you'll still get contact/assignment info where score_board data
> doesn't exist.


perfect! thanks a lot for the ideas.

it turns out that i was specifying (incorrectly) the terms on which to
perform the left join in the 'where ...' section of the query.... which left
me with an empty set result when one table contained no records.

thanks again to everyone who responded!

dylan

 
> -David
> _______________________________________________
> vox-tech mailing list
> vox-tech@lists.lugod.org
> http://lists.lugod.org/mailman/listinfo/vox-tech
>