tags:

views:

23

answers:

2

I'm trying to get values that equal both b.business_id = 22 and l.zip = 91326. The easiest thing for me to try was select l.*,b.name from buslocations AS l left join business as b where b.business_id = '22' and l.zip = '91326' but apparently there is something wrong with that. Any assistance with the correct syntax for two defined values would be appreciated.

+2  A: 

you need to match the tables by some key or value using ON such as:

select l.*,b.name from buslocations AS l left join business as b ON l.x=b.Y WHERE  b.business_id = '22' and l.zip = '91326'
dusoft
eek, I must be tired. Thanks.
ivannovak
...and dusoft wins the race. : )
Aaron F.
+1  A: 

Your join query needs to specify on which columns you're joining the two tables.

http://dev.mysql.com/doc/refman/5.0/en/join.html

Aaron F.