Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2007-11-27
4
Medium Priority
?
431 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

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

As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
By, Vadim Tkachenko. In this article we’ll look at ClickHouse on its one year anniversary.
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

618 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