If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > sql wont work

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-24-04, 00:48
mrbear mrbear is offline
Registered User
 
Join Date: Mar 2004
Posts: 21
sql wont work

i posted a question about how to display the top 5 highest figures in the column, i was given this solution

Select columns
from
(select columns, RANK() OVER (ORDER BY column DESC) RN
from tableA
) V
where V.RN <= 5

but it did not work, i'm using the vb.net and it wont recognize the RANK() OVER and wat does it mean
Reply With Quote
  #2 (permalink)  
Old 03-24-04, 03:16
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
access or sql server?
Code:
select top 5
       thecolumn
  from thetable
order by thecolumn desc
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 03-24-04, 09:16
mrbear mrbear is offline
Registered User
 
Join Date: Mar 2004
Posts: 21
im using sql server
Reply With Quote
  #4 (permalink)  
Old 03-24-04, 09:18
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
sql server supports the TOP syntax i gave
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On