greatest three

Please support our MS SQL advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Mar 2007
Posts: 35
Reputation: bharatshivram is an unknown quantity at this point 
Solved Threads: 1
bharatshivram bharatshivram is offline Offline
Light Poster

greatest three

 
0
  #1
Mar 17th, 2009
hi, i have 3 cols in my db
col 1 ( unique identifier )
col2 ( varchar )
col 3 ( integer )

how can i retrive the 3 greatest values from the database on the basis of col 3..
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,160
Reputation: dickersonka will become famous soon enough dickersonka will become famous soon enough 
Solved Threads: 137
dickersonka dickersonka is offline Offline
Veteran Poster

Re: greatest three

 
1
  #2
Mar 17th, 2009
  1. SELECT top 3 *
  2. FROM tableName
  3. ORDER BY col3 DESC
Custom Application & Software Development
www.houseshark.net
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 35
Reputation: bharatshivram is an unknown quantity at this point 
Solved Threads: 1
bharatshivram bharatshivram is offline Offline
Light Poster

Re: greatest three

 
0
  #3
Mar 17th, 2009
thanx for your reply.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC