J'ai des données qui ressemble à ceci:comment groupe par et compter en utilisant MySQL
ID post_author post_title guid 3309 21 Should somebody not yet on SQL 2008 wait for SQL 2008 R2, since it's near release? http://sql.stackexchange.com/questions/379/should-somebody-not-yet-on-sql-2008-wait-for-sql-2008-r2-since-its-near-release 1695 429 How do we politely decline well meaning advice from the Grandmother? http://moms4mom.stackexchange.com/questions/1208/how-do-we-politely-decline-well-meaning-advice-from-the-grandmother 556 173 Books on how to be a great dad http://moms4mom.stackexchange.com/questions/1042/books-on-how-to-be-a-great-dad 160 30 Building an ice hockey net cam http://photo.stackexchange.com/questions/8/building-an-ice-hockey-net-cam 159 30 Generic commercial photo release form http://photo.stackexchange.com/questions/4/generic-commercial-photo-release-form
Je dois créer une requête qui regroupe les données sur une partie du champ GUID (l'URL racine) et compte le POST_AUTHOR pour chacun.
Le résultat que je cherche serait comme ceci:
Site Count of Authors http://sql.stackexchange.com 1 http://moms4mom.stackexchange.com 2 http://photo.stackexchange.com 2
Je vous serais reconnaissant si quelqu'un me aider à construire le sql.
Merci Virat mais Je veux seulement regrouper sur une partie du champ GUID, l'URL racine, jusqu'à .com –