ORA-00907:missing right parenthesis缺少右括号
生活随笔
收集整理的這篇文章主要介紹了
ORA-00907:missing right parenthesis缺少右括号
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
一,有嵌套查詢,并且子查詢中用了union all合并兩個查詢時,前一個查詢用了order by,那么會報錯并提示ORA-00907:missing right parenthesis缺少右括號:
select * from ( select t.* from emp t where t.job='MANAGER' order by t.empno union all select t.* from emp t where t.job='SALESMAN' )不要像上面那樣寫,如果要實現(xiàn)排序的功能,可以這樣寫:在union all語句的最后面使用order by+數字(數字表示排序的字段的索引)
select t.* from emp t where t.job='MANAGER' union all select t.* from emp t where t.job='SALESMAN' order by 1二,使用in的子查詢中用了order by
select t.* from emp t where t.empno in(select t.empno from emp t order by t.empno )正確的寫法是子查詢中去掉order by
?
創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎勵來咯,堅持創(chuàng)作打卡瓜分現(xiàn)金大獎總結
以上是生活随笔為你收集整理的ORA-00907:missing right parenthesis缺少右括号的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 上证指数30年k线图_技术预判2020:
- 下一篇: 房贷越还越少叫什么