MSSQL and ASP Query

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Oct 2006
Posts: 2
Reputation: Jon.B is an unknown quantity at this point 
Solved Threads: 0
Jon.B Jon.B is offline Offline
Newbie Poster

MSSQL and ASP Query

 
0
  #1
Oct 24th, 2006
Hi All

I am hoping you may be able to help me with a general query I have, I am working on a small script to query our MSSQL database, it is basically a database of search terms, i.e.

Term, Date
help me, 22-10-2006
searchfor, 22-10-2006

What I want to do, and this is more of an query question than VBScript is how I can pull the data from MSSQL to show the most searched for terms, i.e.

Help - exists 302 times in the database
Term - exists 290 times in the database..

I have tried SELECT DISTINCT but that just gives me a number, and I don't know how to count them as they are dynamic.

Any help gratefully appreciated!

Thanks

John
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 483
Reputation: campkev is an unknown quantity at this point 
Solved Threads: 19
campkev campkev is offline Offline
Posting Pro in Training

Re: MSSQL and ASP Query

 
0
  #2
Oct 24th, 2006
i think you want:
  1. select count(term), term from TableName group by term
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the ASP.NET Forum
Thread Tools Search this Thread



Tag cloud for ASP.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC