这个应该是对SQL SERVER 数据库表的操作,请各位帮忙想想,有没有提取相关内容的系统函数或则其它的方法.
select top 10(10条数据)from table minus select top 5(5条数据)from table 就是检索的前10条去掉前5条
你说的那个号在oracle里是没有意义的,就像给一个集合里扔东西一样(堆表),存储数据和时间,顺序等没有关系的。oracle只会考虑把数据存放到合适地方。如果要满足你的要求,就必须加入一个标识的字段。 楼上的那位,oracle中好像没有select top 10(10条数据)from table minus select top 5(5条数据)from table 的用法吧! 如果是选择前多少行,也是采用select *from table where rownum<11 minus select *from table where rownum<6这样的语句吧 不过oracle可以直接用rownum选择行
select top 10(10条数据)from table minus select top 5(5条数据)from table 就是检索的前10条去掉前5条呵呵,明显是对SQL SERVER 数据库表的操作,可以实现楼主的要求
这个不行,执行的结果分别是 top 10 和 top 5 产生的结果集,没有发生相减的过程.
select a.* from (select * ,rownum as rn from table) a where a.rn>10 and a.rn <100
minus
select top 5(5条数据)from table
就是检索的前10条去掉前5条
楼上的那位,oracle中好像没有select top 10(10条数据)from table
minus
select top 5(5条数据)from table
的用法吧!
如果是选择前多少行,也是采用select *from table where rownum<11
minus
select *from table where rownum<6这样的语句吧
不过oracle可以直接用rownum选择行
minus
select top 5(5条数据)from table
就是检索的前10条去掉前5条呵呵,明显是对SQL SERVER 数据库表的操作,可以实现楼主的要求
(select * ,rownum as rn from table) a
where a.rn>10 and a.rn <100