Results 1 to 3 of 3
  1. #1
    Join Date
    May 2004
    Posts
    1

    Question Unanswered: Select Syntax Question

    Hi,

    I'm relatively new to Sybase, and I can't seem to find any way to select a specific row segment from a table. Say I have a table that has 200,000 rows and I only want to select rows numbered 1,000-4,000. Is this possible?

    I thought about adding a numeric field to the table and updating that field with a number using a while loop, but that would take quite a bit of time for 200,000 records.

    Any recommendations from the gurus out there?

    Thanks,

    Don

  2. #2
    Join Date
    Jan 2004
    Posts
    51
    I don't think there is any option in select.., but you can achieve the same using following code

    --suppose you want to the range of rows from low_no to high_no..

    set rowcount high_no
    select * into #tmp from Table

    set rowcount low_no-1
    delete #tmp
    set rowcount 0
    select * from #tmp

  3. #3
    Join Date
    Aug 2003
    Location
    Maryland
    Posts
    17

    Thanks Sushant!

    Thanks,

    Bill

Posting Permissions

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