0

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 Answers 2

2

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'
Sign up to request clarification or add additional context in comments.

2 Comments

eek, I must be tired. Thanks.
...and dusoft wins the race. : )
1

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.