[thelist] SQL Most/Count Query

Chris Blessing webguy at mail.rit.edu
Thu Nov 14 13:32:01 CST 2002


I would think you'd wanna do a ...

select searchterm, count(searchterm) [num] from searchterms
group by searchterm
order by [num] desc

That would give you a list of all the search terms (only one if there are
more than 1 of the same) and the number of times it occured in the table,
ordered by the most occurences to the least occurences.

I still might be missing your actual question though... sorry it's a slow
day. ;)

Chris Blessing
webguy at mail.rit.edu
http://www.330i.net

> Ok Chris (and group)
>
> cats and cats-2 are two completely different items. I want to sort through
> my couple of thousand rows into explicit search strings. for
> example I have
> 14 JCKa's and 29 JCKb's.
>
> Rob




More information about the thelist mailing list