unexcept token. token is : 'union', at line 33 column 2, token type is 'Keyword'

来源:互联网 发布:mobilebugfix.mini.js 编辑:程序博客网 时间:2024/05/21 06:39

两表合并时 使用union all 必须给表设置别名、还得注意明确字段

e.g:

select userInfo1.userName as uName,userInfo2.passWord  as pw from (select * from user) userInfo1

union all

select userInfo2.userName as uName,userInfo2.passWord  as pw from (select * from user) userInfo2