sql语句取id不连续的内容由刀豆文库小编整理,希望给你工作、学习、生活带来方便,猜你可能喜欢“自动生成id的sql语句”。
写出一条Sql语句:取出表A中第31到第40记录(SQLServer,以自动增长的ID作为主键,注意:ID可能不是连续的SQL语句为:
select * from A where ID >=31 and ID
ORACLE语句为:
select * from A where RowNum>=31 and RowNum
ORACLE和SQL都能使用的是
select top 10 * from(select top 40 * from A order by ID)order by ID desc或者是
select top 10 * from AwhereID not in(selectID from top30 fromA)
写出一条Sql语句:取出表A中第31到第40记录和第50到第60的记录(SQLServer,以自动增长的ID作为主键,注意:ID可能不是连续的select * from news where(id >=31 and id =50 and id
select * from news whereid >=31 and id =50 and id