Select skip n

  • Hi,

    RDBMS : sqlserver 2005

    how can I write select query to skip top n records?

    I don't want to use order by and then top

  • create table #aa

    (

    id int identity(1,1),

    col1 varchar(30)

    )

    insert into #aa(Col1)

    select col1 from yourtable

    select * from #aa where id>10

    Spandan Buch

  • this is not thee way I am looking for

  • select * from yourtab

    except

    select top(10) * from yourtab

    Spandan Buch

  • you can use the row number function to do paging...is that what you are looking for?

    I don't want to use order by and then top

    is this a homework or interview question?

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • thanks it worked 🙂

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply