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
Solved

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

Posted on 2007-11-27
4
425 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 500 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Fore-Foreword Today (2016) Maxmind has a new approach to the distribution of its data sets.  This article may be obsolete.  Instead of using the examples here, have a look at the MaxMind API (https://www.maxmind.com/en/geolite2-developer-package). …
Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

840 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