This topic has been archived. It cannot be replied.
-
工作学习 / 事业与工作 / 请问: 对于 MS SQL server 的 SQL 语法: select top 20 * from test where ..., 如何我想返回第100 行到200行的结果. 如何写?! 就像Oracle 中的
rownum>100 and rownun<200 , 或 Mysql 的 select * from test limit 100,200 , Thanks .
-zeus(法老);
2002-8-8
(#682502@0)
-
没办法,除非自己加一列来做rownum。变通的办法是select top 200,然后自己找100-200
-miketany(MIKE老狼);
2002-8-8
(#682564@0)
-
top 200 order反过来,再top101,如何?
-guestagain(guest again);
2002-8-8
(#682589@0)
-
1.你要100-200行得数据, 肯定是这些数据满足你一定得条件,so,可以用这条件来取出数. 2. 如果是一个常用得查询, 那随着数据得变化, 满足你要求得永远是100-200行得数据吗? 如果不是, 用具体条件取代航数更可行.
-mjs(臭豆腐-香喷喷);
2002-8-8
(#682601@0)
-
如果在VB里面写,可以用RecordSet的Cursor。其他的不知道。
-jqian(Q_Q);
2002-8-9
(#682646@0)
-
select top 100 from ( select top 300 from test order by ID desc)
order by ID ascMSDN has such example
-interview(intervieweree);
2002-8-9
{21}
(#682841@0)
-
I'm new to Oracle. In Oracle, can you specify rownum > 100?
-interview(intervieweree);
2002-8-9
(#682846@0)
-
sql is not like dbf which is a radom access data file, in most case it makes no sence to get 100 to 200 records in a table/view. however if you insist, you can define a key field to index and trace all of the records.
-bigdesk(nothing);
2002-8-9
(#682895@0)