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

解决方案 »

  1.   

    改为
    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
      

  2.   

    to waterfirer(水清) 
    因为这句SQL是由一个CLASS生成的。所以a.col1, a.col2, b.col1  &  a.col1, a.col2, b.col1 这两部分得一样,这样有没有什么办法实现?
      

  3.   

    select c1, c2, c3 
    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