MySQL Forums
Forum List  »  General

GROUP BY and COUNT
Posted by: Kadir Güngör
Date: June 13, 2009 04:26AM

I have a table like this,

---- ------
Name blabla
---- ------
Book 3
Book 3
Book 8
Book 7
Book 7
Book 0
Book 65
Book 65
Book 65
Book 1
Book 0
Book 9
Book 9
Book 9
Book 9
Book 9
Book 9
Book 9
Book 1
Book 0



How can I group and count the last column and get an output like below?

---- ------ -----
Name blabla count
---- ------ -----
Book 3 2
Book 8 1
Book 7 2
Book 0 1
Book 65 3
Book 1 1
Book 0 1
Book 9 7
Book 1 1
Book 0 1

Options: ReplyQuote


Subject
Written By
Posted
GROUP BY and COUNT
June 13, 2009 04:26AM
June 13, 2009 05:09AM
June 13, 2009 06:36AM
June 13, 2009 01:21PM
June 13, 2009 01:43PM
June 13, 2009 01:58PM
June 13, 2009 08:30PM


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.