?
Solved

1054 - Unknown column 'm.manufacturers_name' in 'where clause'

Posted on 2007-11-27
4
Medium Priority
?
432 Views
Last Modified: 2012-08-13
What would be the best way to troubleshoot this error:

1054 - Unknown column 'm.manufacturers_name' in 'where clause'

select count(distinct p.products_id) as total from products p left join specials s on p.products_id = s.products_id, products_description pd, categories c, products_to_categories p2c where p.products_status = '1' and c.categories_status = '1' and p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and ((pd.products_name like '%solar%' or p.products_model like '%solar%' or m.manufacturers_name like '%solar%') )

Thanks
0
Comment
Question by:dpaule
  • 2
4 Comments
 
LVL 20

Accepted Solution

by:
steelseth12 earned 2000 total points
ID: 20357114
Break up your conditions so they are easier to read.
In this case you can see that you dont have a table alias m
You only have

products p and

specials s



select count(distinct p.products_id) as total from
products p left join
specials s
on p.products_id = s.products_id, products_description pd, categories c, products_to_categories p2c where p.products_status = '1'
and c.categories_status = '1'
and p.products_id = pd.products_id
and pd.language_id = '1'
and p.products_id = p2c.products_id
and p2c.categories_id = c.categories_id
and ((pd.products_name like '%solar%'
or p.products_model like '%solar%' or m.manufacturers_name like '%solar%') )
0
 
LVL 23

Expert Comment

by:Ashish Patel
ID: 20357137
select count(distinct p.products_id) as total from products p left join specials s on p.products_id = s.products_id, products_description pd, categories c, products_to_categories p2c where p.products_status = '1' and c.categories_status = '1' and p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and ((pd.products_name like '%solar%' or p.products_model like '%solar%' or p.manufacturers_name like '%solar%') )
0
 

Author Closing Comment

by:dpaule
ID: 31411174
I removed any reference to m.manufacturers_name since I didn't need to search in the manufacturers table.
0
 

Author Comment

by:dpaule
ID: 20357475
I removed any reference to m.manufacturers_name since I didn't need to search in the manufacturers table.
0

Featured Post

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Containers like Docker and Rocket are getting more popular every day. In my conversations with customers, they consistently ask what containers are and how they can use them in their environment. If you’re as curious as most people, read on. . .
Recursive SQL is one of the most fascinating and powerful and yet dangerous feature offered in many modern databases today using a Common Table Expression (CTE) first introduced in the ANSI SQL 99 standard. The first implementations of CTE began ap…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month13 days, 17 hours left to enroll

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question