Results 1 to 4 of 4

Thread: sql wont work

  1. #1
    Join Date
    Mar 2004
    Posts
    21

    Unanswered: 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

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    access or sql server?
    Code:
    select top 5
           thecolumn
      from thetable
    order by thecolumn desc
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Mar 2004
    Posts
    21
    im using sql server

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    sql server supports the TOP syntax i gave
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •