select word, count(word) as c from tablename group by word order by c
desc
On Thu, 19 Apr 2001, Graham Nichols wrote:
> Hi,
>
> I have a list of words entered into a search engine held in a database. I
> wish to be able to select the top 10 words held in the database. I've
> fiddled around with ORDER DESC, DISTINCT and LIMIT etc but I can't hit upon
> the SQL syntax to obtain the correct result. Can someone please shine a
> light on my dim brain? The words are held in the dtaabase column 'word'. I'm
> having a really 'dumb' day today :-(
>
> Thanks, Graham
>
>
>
> ---------------------------------------------------------------------
> 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
>
>
--
-----------------------------------------------
Peter Skipworth
Perl Developer/Unix Systems Administrator
[EMAIL PROTECTED]
+44 795 055 0029
-----------------------------------------------
4c 61 20 6c 6f 79 52 75 62 20 73 41 20 65 52 61
20 45 65 62 4f 4c 47 6e 74 20 20 4f 53 75 00 0a
---------------------------------------------------------------------
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