Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Short query question (Where clause ..)
July 26, 2005, 6:09 pm
rate this thread
I can not seem to figure out where
to put my WHERE clause in the next query:
COUNT(p.id) AS 'quantity'
FROM pr_series s
LEFT JOIN pr_products p
GROUP BY s.id, s.name
WHERE s.kind_id = '1'
ORDER BY s.name ASC
LIMIT 0, 20
This gives me a mysql error, and i can't find out where to put "WHERE
s.kind_id = '1'". I'm new to the LEFT JOIN & GROUP BY things, i've read
about it but, as i said, can't get it to work ... :(
Are the WHERE and JOIN / GROUP BY parts not meant to be in 1 query?
Any help would be greatly appreciated ...
Re: Short query question (Where clause ..)
Examples are shown all throughout the mysql manual if thats what you are
using. Try looking at the JOIN SYTAX page for more details (
P.S. The WHERE should be before the GROUP BY clause.