select col1, col2, col1
from (
select row_.*, rownum rownum_ from (
select a.col1, a.col2, b.col1 from msg a, rule_time_subject_msg b ORDER BY 2) row_ where rownum <= 20) where rownum_ > 0
from (
select row_.*, rownum rownum_ from (
select a.col1, a.col2, b.col1 from msg a, rule_time_subject_msg b ORDER BY 2) row_ where rownum <= 20) where rownum_ > 0
解决方案 »
- truncate table原理
- 关于Oracle记录随机排序
- Oracle批量更新及聚合函数Group By的问题,在线等,急——————————————————————
- 查询结果的某字段合并——急等大牛来助!
- 请教sql多表多组队条件的查询
- 请教一句SQL语句
- oracle数据库连接问题,急~~~
- 在 oracle 网站下载的 Oracle 10g 与购买正版的有什么区别呢?
- 无法登录到Oracle Management Server??
- 在PL/SQL中,在执行动态SQL中,什么时候要用到EXECUTE IMMEDIATE,谢谢
- 我之前一点没接触过数据库,现在想学oracle,需要什么基础么?
- group by 的问题
select col1, col2, col11
from (
select col1,col2,col11,rownum rownum_ from (
select a.col1 col1, a.col2 col2, b.col1 col11
from msg a, rule_time_subject_msg b
where rownum <= 20 ORDER BY 2
) row_
)
where rownum_ > 0
因为这句SQL是由一个CLASS生成的。所以a.col1, a.col2, b.col1 & a.col1, a.col2, b.col1 这两部分得一样,这样有没有什么办法实现?
from (
select row_.*, rownum rownum_ from (
select a.col1 c1, a.col2 c2, b.col1 c3 from msg a, rule_time_subject_msg b ORDER BY 2) row_ where rownum <= 20) where rownum_ > 0