出现这个错误的语句是酱紫的

select xxx from aaa order by xxx
union all
select yyy from bbb order by yyy

错误原因居然是,如果同时用了union all 和 order by,union all的子句要加上括号。

所以下面的写法就不会报错了。

(select xxx from aaa order by xxx)
union all
(select yyy from bbb order by yyy)

 

相关文章:

  • 2022-12-23
  • 2021-11-27
  • 2022-12-23
  • 2021-08-08
  • 2021-07-21
  • 2022-12-23
  • 2021-10-26
  • 2021-10-16
猜你喜欢
  • 2022-12-23
  • 2022-01-03
  • 2021-08-25
  • 2021-10-05
  • 2021-10-25
  • 2022-01-02
相关资源
相似解决方案