MySQL Forums
Forum List  »  Italian

Re: Query - costruire un sommario (HELP)
Posted by: Luciano Mammino
Date: August 30, 2007 07:13AM

Qualcuno mi ha suggerito di usare una join!

SELECT qz_categories.id, qz_categories.name, COUNT(qz_questions.category_id) as total
FROM qz_categories LEFT JOIN qz_questions ON (qz_questions.category_id = qz_categories.id)
GROUP BY qz_categories.id


Funziona a meraviglia!
Spero almeno questo post possa tornare utile a qualcuno! ;)

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Query - costruire un sommario (HELP)
2773
August 30, 2007 07:13AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.