homepage Welcome to WebmasterWorld Guest from 184.72.91.94
register, login, search, subscribe, help, library, PubCon, announcements, recent posts, open posts,
Pubcon Website
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library : Charter : Moderators: physics & whoisgregg

Databases Forum

    
Group by highest number count
group by highest number count
chrissim




msg:4141073
 12:30 am on May 27, 2010 (gmt 0)


hi,

i can retrieved all data count number group by specific column but the list are huge and i would like to retrieve and show only the group highest count number > 0. i tried to add ' FROM uniquelog where by useragent > 0' but the result were all nil. Could someone shows me the right path
Thanks



$data = mysql_query("SELECT DISTINCT useragent, round(count(useragent)/$num_rows * 100,2) as numscene FROM uniquelog WHERE useragent IS NOT NULL AND useragent!= '' GROUP By useragent")
or die(mysql_error());

 

chrissim




msg:4141209
 2:50 am on May 27, 2010 (gmt 0)

nevermind i have figure out by applying 'HAVING Total > 3' at the end of Group By and it worked pretty well now. Thx

whoisgregg




msg:4145230
 9:49 pm on Jun 1, 2010 (gmt 0)

Glad you got it sorted out chrissim. :)

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Databases
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
WebmasterWorld ® and PubCon ® are a Registered Trademarks of Pubcon Inc.
© Pubcon Inc. 1996-2012 all rights reserved