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.
Add a comment
|
2 Answers
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'
2 Comments
Ivan Novak
eek, I must be tired. Thanks.
Aaron Fi
...and dusoft wins the race. : )
Your join query needs to specify on which columns you're joining the two tables.