13544870125 发表于 2016-11-12 06:50:10

读取前几条数据的sql语句

access:

select top* from table1 where 1=1

db2:

select column from table where 1=1 fetch first 10 rows only

mysql:

select * from table1 where 1=1 limit 10

sql server:

读取前10条:select top* from table1 where 1=1

读取后10条:select top* from table1 order by id desc

在sqlserver里面,如何读取按照某个排序,第5到10这五个记录

select top 6 * from table where id not in

oracle:

select * from table1 where rownum=10
页: [1]
查看完整版本: 读取前几条数据的sql语句