mySQL: Joining three tables - how?
Posted
by Industrial
on Stack Overflow
See other posts from Stack Overflow
or by Industrial
Published on 2010-06-06T16:02:16Z
Indexed on
2010/06/06
16:12 UTC
Read the original article
Hit count: 229
Hi everybody,
I have the following query in my application. It works well, but I need it to also contain the number of products that are associated with each manufacturer.
The current query:
SELECT * FROM (`manufacturers`)
JOIN `languages` ON `manufacturers`.`lang` = `languages`.`id`
ORDER BY `languages`.`id` asc, `id` asc
My products table looks like this:
id | name | manufacturerid
0 | Product1 | 0
© Stack Overflow or respective owner