About Top N Records

Results 1 to 3 of 3

Thread: About Top N Records

  1. #1
    Join Date
    Dec 1969
    Posts
    37

    Default About Top N Records

    Hi, everyone<BR>i have a database include 5 fields(id, name, date, url, linkhits)<BR>i want to know how to display top 10 records which have more linkhits than others.<BR>Can anyone tell me<BR>thanks a lot

  2. #2
    Nathen Grass Guest

    Default RE: About Top N Records

    If you&#039re using SQL Server then try:<BR><BR>SET ROWCOUNT 10<BR>SELECT * FROM table ORDER BY LinkHits DESC<BR><BR>If you&#039re using Access then try:<BR><BR>SELECT TOP 10 * FROM table ORDER BY LinkHits DESC

  3. #3
    Join Date
    Dec 1969
    Posts
    2,849

    Default RE: About Top N Records

    The TOP notation works fine in SQL Server... at least 6.5 and up.

Posting Permissions

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