[BNM] mysql grouping and ordering and limiting

Ali ali at nubz.com
Thu Jan 22 17:00:24 GMT 2009


sorry quick typo in my original query should be

$q="select authorId, count(*) FROM blog WHERE 1 GROUP BY authorId";

Ali


-----Original Message-----
From: bnmlist-bounces at brightonnewmedia.org
[mailto:bnmlist-bounces at brightonnewmedia.org] On Behalf Of Ali
Sent: 22 January 2009 16:59
To: Brighton New Media
Subject: [BNM] mysql grouping and ordering and limiting

Hi

 

Hopefully this is a quickie for someone, my first efforts are duds and
googling is a pain...

 

$q="select authorId, count(*) FROM blog WHERE 1 GROUP authorId";

 

Now I want to limit to, say 10 authors and order by count(*) descending -
can anyone indulge me with the syntax?

 

Ali

-- 

BNM Subscribe/Unsubscribe:
http://www.brightonnewmedia.org/options/bnmlist

BNM powered by Wessex Networks:
http://www.wessexnetworks.com
No virus found in this incoming message.
Checked by AVG - http://www.avg.com 
Version: 8.0.176 / Virus Database: 270.10.10/1904 - Release Date: 22/01/2009
07:08



More information about the BNMlist mailing list. Powered by Wessex Networks