Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2003
    Posts
    52

    Unanswered: Selecting n registers

    Suposse you have

    SELECT * FROM table WHERE id = 30


    and this query brings 20 registers from the table,but i just wanna bring the first 5 registers of this query

    I've done this in SQL server with

    SELECT TOP 5 * FROM Customers


    and in Sybase, i've found something like

    SELECT
    * INTO table WITH MAX_ROWS_PER_PAGE = 5
    FROM
    table

  2. #2
    Join Date
    Feb 2002
    Location
    Willy is on vacation
    Posts
    1,208

    Re: Selecting n registers

    Originally posted by quetzalcoatl
    I've done this in SQL server with
    SELECT TOP 5 * FROM Customers
    SET ROWCOUNT 5
    SELECT * FROM table WHERE id = 30
    ORDER BY id asc
    SET ROWCOUNT 0

  3. #3
    Join Date
    Nov 2003
    Posts
    52

    Smile

    Thans a lot

  4. #4
    Join Date
    Nov 2002
    Location
    Switzerland
    Posts
    524

    Post

    TOP, LIMIT , ... are some new behavior in version 12.5.1

Posting Permissions

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