"Tyler Longren" <[EMAIL PROTECTED]> wrote:
> I've got a table that contains a list of bands. There's a field named
> views. This field contains how many times each band's page has been
viewed.
>
> Ex:
> id artist views
> 1 No names 6
> 2 WISH 10
> 3 Deftones 45
>
>
> What's the SQL to select the top 2 most viewed bands
SELECT artist
FROM my_table
ORDER BY views DESC
LIMIT 2
--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php