Click to See Complete Forum and Search --> : sql script help


RabBell
07-10-2007, 06:52 AM
I've been using SQL for a while but I'm kinda stumped as to where to start with this one. I have a search function on my ecommerce site and whatever anyone searches for is being stored in a database.

I need a script that will look at my search entries table and return a list of the most popular search terms.

So go to the table and produce result like

Search Term (count)
Harry Potter (6)
Sherlock Holmes (4)
Garfield (2)

But like I say, I'm a little stumped as to where to even begin with this one.

bubbisthedog
07-10-2007, 02:22 PM
Maybe something like...

select movie, count(movie)
from movies
group by movie