Is there a portable way to have “SELECT FIRST 10 * FROM T” semantic?

前端 未结 5 1345
死守一世寂寞
死守一世寂寞 2020-12-10 03:56

I want to read data in blocks of say 10k records from a database.

I found Result limits on wikipedia and it seems obvious that this can\'t done with sql in a portabl

5条回答
  •  眼角桃花
    2020-12-10 04:31

    There is an ANSI standard syntax from SQL:2008:

    SELECT t.* 
      FROM TABLE t
     FETCH FIRST 10 ROWS ONLY
    

    ...but it's not supported on most databases at this time.

提交回复
热议问题