Re: Determining Top # from MySQL

From: Date: Sun, 11 Apr 2010 05:21:19 +0000
Subject: Re: Determining Top # from MySQL
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-303982@lists.php.net to get a copy of this message
If you want to take top 5: SELECT num, COUNT( num ) as c FROM table GROUP BY num order by c desc limit 5 Thanks, Vikash Kumar -- http://vika.sh On Sun, Apr 11, 2010 at 8:07 AM, Dan Joseph <dmjoseph@gmail.com> wrote: > Eh, he's off topic, but we've talked plenty SQL on here before... > > SELECT num, COUNT( num ) FROM table GROUP BY num; > > I don't have a myqsl server to test that, but should do it. > > -- > -Dan Joseph > > www.canishosting.com - Unlimited Hosting Plans start @ $3.95/month. Promo > Code "NEWTHINGS" for 10% off initial order > > http://www.facebook.com/canishosting > http://www.facebook.com/originalpoetry >

« previous php.general (#303982) next »