表中是否有唯一标识的字段,如为IDSELECT * FROM tbl ORDER BY ID LIMIT 5,6; 参考MYSQL HELP SELECT * FROM tbl LIMIT 5,10; # Retrieve rows 6-15
select * from A limit 5,10
没有id作为标志哦 limit是排序操作吗 那会不会比较消耗资源呢 因为数据量挺大的
不写字段 直接limit就是按照行号筛选吗
oracle: select * from a where rownum>=6 and rownum<=17 mysql: select * from A limit 6,10
例如我有一张表tblMaterial(MatID, BH, MC, DW),其中MatID为主键,并且自动递增。 现在假设我要取第10行至15行的数据,我的做法如下: select top 6 * from tblMaterial where MatID not in( select top 9 MatID from tblMaterial )
参考MYSQL HELP
SELECT * FROM tbl LIMIT 5,10; # Retrieve rows 6-15
select * from a where rownum>=6 and rownum<=17
mysql:
select * from A limit 6,10
现在假设我要取第10行至15行的数据,我的做法如下:
select top 6 *
from tblMaterial
where MatID not in(
select top 9 MatID
from tblMaterial
)