mySQL: Select WHERE causes error - why?
Posted
by Industrial
on Stack Overflow
See other posts from Stack Overflow
or by Industrial
Published on 2010-06-07T12:30:58Z
Indexed on
2010/06/07
12:32 UTC
Read the original article
Hit count: 487
Hi everybody,
I have this query:
SELECT `manufacturers`.*, `languages`.*, COUNT(`products`.`id`) AS productcount
FROM (`manufacturers`)
WHERE manufacturers.flushed = 0
JOIN `languages` ON `manufacturers`.`lang` = `languages`.`id`
LEFT OUTER JOIN `products` ON
`products`.`manuf` = `manufacturers`.`mid`
GROUP BY manufacturers.id
ORDER BY `languages`.`id` asc, `manufacturers`.`mid` asc;
Without the WHERE row, everything works great, but with it, I get a Error 1064 (Syntax error) thrown in my face. I guess that it has something to do with the actual placement of the WHERE row in the query, so I tried to move it around, but without any luck.
What can I do?
© Stack Overflow or respective owner