有如下sql,两个表列类型等都相同,在oracle下可以正常运行,在sqlserver 下就会报错select * from
(
select * from pub_todoout
union
select * from pub_todo
)
消息 102,级别 15,状态 1,第 6 行
')' 附近有语法错误。SQLunion
(
select * from pub_todoout
union
select * from pub_todo
)
消息 102,级别 15,状态 1,第 6 行
')' 附近有语法错误。SQLunion
select * from
(
select * from pub_todoout
union
select * from pub_todo
) AS T
这样就好了,需要给他一个名称
select * from
( select * from pub_todoout unionselect * from pub_todo ) as a