在使用union的时候提示:ORA-00907:缺少右括号

此原因是因为在union的左边和右边都有order by,因此需要去掉一边的order by,保留一个即可。

例如:

select * from 

(

 select id,name from emp

order by name

union

 select id,name from emp


)

或者:

 

select * from 

(

 select id,name from emp


union

 select id,name from emp


order by name

相关文章:

  • 2021-05-31
  • 2021-05-15
  • 2021-07-10
  • 2021-12-12
  • 2021-12-11
  • 2021-09-16
  • 2021-06-04
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-24
  • 2021-07-09
  • 2021-11-23
  • 2021-08-01
  • 2022-12-23
相关资源
相似解决方案