怎样用select语句只读取表单里面符合条件的前几条记录?
我想用select语句去读取表单里面符合条件的前几条记录.比如说符合条件的记录有几千条,但我只想读取前面几条记录而已. 问题点数:20、回复次数:4Top
1 楼zsq0759(john.zhong)回复于 2001-12-19 17:14:59 得分 0
oracle语句:DTop
2 楼zhq2000(方舟)回复于 2001-12-19 17:18:17 得分 0
fetch the first 10 records!
select * from where ( ... ) and (rownum < 10)Top
3 楼zhq2000(方舟)回复于 2001-12-19 17:18:40 得分 12
fetch the first 10 records!
select * from where ( ... ) and (rownum <= 10)Top
4 楼catwg77(野猫)回复于 2001-12-19 17:23:20 得分 8
你可以用Oracle 中的伪列 rownum 参数就可以了!
例如:select * from usertab where rownum <=10;
这样就只显示符合条件的前十条记录。 Top




