944,126 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 2793
  • ASP.NET RSS
Oct 24th, 2006
0

MSSQL and ASP Query

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Jon.B is offline Offline
2 posts
since Oct 2006
Oct 24th, 2006
0

Re: MSSQL and ASP Query

i think you want:
ASP.NET Syntax (Toggle Plain Text)
  1. select count(term), term from TableName group by term
Reputation Points: 14
Solved Threads: 19
Posting Pro in Training
campkev is offline Offline
484 posts
since Jul 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: Passing values from server-side code to html
Next Thread in ASP.NET Forum Timeline: adding up checkbox values





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC