select * from (select rownum no,col1,col2,...,coln from tbname group by col1,col2,...coln)
where no>(select count(0)-6 from tbname);
where no>(select count(0)-6 from tbname);
解决方案 »
- 一条无法执行的SQL语句,大家来找毛病
- Oracle 触发器 容错??
- 为什么出现ORA-00001: 违反唯一约束条件
- oracle 10 g 出现table or view does not exist
- 请教:如何得到当前日期的下一天?
- 我想在存储过程中加入条件?怎么处理?
- oracle中没有没与sql server中osql.exe类似的命令行程序,不是指sqlplus,在线等
- 那里有WebDB下载啊.
- 怎样通过SQL语句设定对一个表的只读、读写权限???
- 我的问题是这样的:
- 疯狂问:安装from builder 和 oracle report from 等开发工具时需要安装oracle客户端吗?还需要什么配置才可以连接到连网服务器上的oracl
- 关于spool
where no>(select count(0)-6 from tbname) order by no desc;
ORARichard(没钱的日子好难过啊)兄可能忘了加order by :)
where no>(select count(0)-6 from tbname) order by no desc;
把)给弄丢了,不好意思!
----------
10
1
8
6
15
150
16
19已选择8行。SQL> select id from(
2 SELECT id,
3 row_number()
4 OVER (PARTITION BY 1
5 ORDER BY id desc NULLS LAST) top_6
6 FROM bb) b
7 where b.top_6<=6; ID
----------
150
19
16
15
10
8已选择6行。