錯誤語句:select id,name from s1 order by stime union all select id,name from s2 order by stime
報錯原因:oracle 搜索到order by后認為整個select語句就該結束了但是后面還有union all所以數據庫無法解析,導致報錯
處理辦法:with a1 as (select id,name from s1 order by stime) , a2 as (select id,name from s2 order by stime) select * from a1 union all select * from a2