[thelist] SQL Most/Count Query

Rob Smith rob.smith at THERMON.com
Thu Nov 14 13:43:01 CST 2002


Sweet!

That was a big help. Here I was *thinking* about going the long way, perhaps
attempting multidimensional arrays, temporary tables, etc.

<tip type="Bridges" author="Rob.Smith">
As you build your bridges in life, the only reason you should burn them is
you know without a doubt your path will never pass that crossing again.
However, if your path does come back to that crossing, forget it and turn
around. Moral of the story: Never burn your bridges.
</tip>

Rob.Smith

-----Original Message-----
From: Chris Blessing [mailto:webguy at mail.rit.edu]
Sent: Thursday, November 14, 2002 1:36 PM
To: thelist at lists.evolt.org
Subject: RE: [thelist] SQL Most/Count Query


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

--
* * Please support the community that supports you.  * *
http://evolt.org/help_support_evolt/

For unsubscribe and other options, including the Tip Harvester
and archives of thelist go to: http://lists.evolt.org
Workers of the Web, evolt !



More information about the thelist mailing list