Mysql join statement not working...

Can someone let me know what the  problem is with this statement:

select b.branch, b.address,b.region, i.installer from supplier_branch b INNER JOIN
supplier_branch_map i ON supplier_branch.branch_id=supplier_branch_map.branch_id
order by supplier_branch.branch

The error I am getting is:

#1054 - Unknown column 'supplier_branch.branch_id' in 'on clause'

Thanks,
A
aej1973Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mukesh YadavFull Stack DeveloperCommented:
Error occurred because you provided wrong column name.

Can you share you tables(supplier_branch, supplier_branch_map) structure.
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
since you're using Alias clause, try this:

select b.branch, b.address,b.region, i.installer from supplier_branch b INNER JOIN
supplier_branch_map i ON b.branch_id=i.branch_id
order by b.branch

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Walter RitzelSenior Software EngineerCommented:
Also, there is a possibility of the casing of characters: altough in phpmyadmin or even mysqlworkbench this query will work all in lower case, maybe when called from your php code or python code, it does not work. MySQL is case sensitive regarding table and field names, so branch_id is not the same as Branch_ID, for example. So, please check your table structures, respect the case when typing the query and if you give alias to your tables, please use them on your query ON clause. So, all three answers here may help you to solve your problem.
aej1973Author Commented:
Thank you, it works.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
MySQL Server

From novice to tech pro — start learning today.