sql - how to group by and count using MySQL -
I have data that looks like this:
ID post_author post_title guid 330 9 21 what Should not anyone have yet to wait for SQL 2008 SQL 2008 R2, because this release is near? Http://sql.stackexchange.com/questions/379/should-somebody-not-yet-on-sql-2008-wait-for-sql-2008-r2-since-its-near-release1695 429 How We Do Can you naturally drop the advice of well meaning from sleep? Http://moms4mom.stackexchange.com/questions/1208/how-do-we-politely-decline-well-meaning-advice-from-the-grandmother 553 How to Become a Great Father Read books http: // moms4mom .stackexchange.com / question / 1042 / book-on-how-of-one-great-papa 160 30 Creating a Ice Hockey Net Camera http://photo.stackexchange.com/questions/8/building-an- Ice-hockey-net-cam 159 30 General Professional Photo Release Form http://photo.stackexchange.com/questions/4/generic-commercial-photo-release-form
I need to make a query This group is on the part of the GUID field (Route URL) and data on the prefix POST_AUTHOR counts to be.
The result I am looking for will be like this:
If someone helps me in building SQL then I would be grateful.
SELECT COUNT (POST_AUTHOR) as AUTHOR_COUNT, by the GUI D FROM TABLE_NAME group GUID < / Code>
Comments
Post a Comment