SQL Query: How can I get data of row with number 1000 direclty?

前端 未结 3 832
耶瑟儿~
耶瑟儿~ 2021-01-01 09:31

If I have a SQL Table called Persons that contain about 30000 rows and I want to make a SQL query that retrieve the data of row number 1000 ... I got it by non

3条回答
  •  既然无缘
    2021-01-01 09:53

    you can try this

    select * from Person P
    where 999 = ( select count(id) from Person P1 , Person P2 
                  where P1.id = P.id and P2.id < P1.id)
    

提交回复
热议问题