1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

how to use Limit in Sql server

Discussion in 'SQL Server' started by prabhat1, Apr 9, 2008.

  1. prabhat1

    prabhat1 New Member

    hiiiiiiii.......... i want to use limit in my query to show only few items from database.

    For example i have ..10 values in my table but at a time i want to retrieve only 5 at a time

    The LIMIT works well in My SQL but not in SQL server

    please gve me the sample query.......

    thanks in advance..........

    prabhat..........
     
  2. sql-programs

    sql-programs New Member

    Sql Server does not have a LIMIT functionality. You can use TOP.

    Code:
    select TOP 5 * from Table1
     
  3. urstop

    urstop New Member

    You can use TOP to get the required number of records from the starting position in the result set, but there is no direct way to get records from a specific position as we have with LIMIT.
     

Share This Page