oracle僞列示例。在大表中作用尤爲明顯。

select a.*
          from (select t.*, a.account_code, rownum as rn
                  from (select *
                          from t_sm_box_txt_13
                        union all
                        select * from t_sm_box_txt_01) t
                 inner join t_account_info a
                    on a.account_id = t.account_id
                 where 1 = 1
                   and t.src_terminal = '106590790118114'
                   and rownum <= 30
                 order by t.box_id desc) a
 where rn >= 15
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章