selecting a top of ocorrences in a table

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
pedrotuga
Forum Contributor
Posts: 249
Joined: Tue Dec 13, 2005 11:08 pm

selecting a top of ocorrences in a table

Post by pedrotuga »

I have the referers to my site in a table and I want to view a top of the linking-in sites. the tables has both the domain and the complete referer.

This should be like the question asked a 1000 times, buti couldnt find anything similar using the search.

How do i get a top of the domains linking in? any hints on the sql code?

like

google.com
677 hits

yahoo.com
100 hits

blaba.co.uk
20 hits
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

GROUP BY clause.
User avatar
pedrotuga
Forum Contributor
Posts: 249
Joined: Tue Dec 13, 2005 11:08 pm

Post by pedrotuga »

yep... this was stupid of me... group by, of course!

thank you
Post Reply