select * from ta union all select * from tb order by c
select * from( select * from A union all select * from B)a where c='as' order by c
select * from a union select * from b order by c其实楼上的加不加T都代表“表”的名字。呵呵!
select * from A union all select * from B order by c
CREATE PROCEDURE P_GetMapSearch @district VarChar(30) ASselect * from Message where district=@district union all select * from Message2 where district=@district order by datetime GO出现错误205 包含UNION 运算符的SQL语句中的所有查询都必须在目标列表中具有相同数目的表达式?? 这是什么原因
两表列数不同,字段个数不同。可以写成 select a,b from ta union all select a,b from tb
union all
select * from tb
order by c
select * from A union all
select * from B)a
where c='as'
order by c
select * from A
union all
select * from B
order by c
@district VarChar(30)
ASselect * from Message where district=@district
union all
select * from Message2 where district=@district
order by datetime
GO出现错误205 包含UNION 运算符的SQL语句中的所有查询都必须在目标列表中具有相同数目的表达式??
这是什么原因
select a,b from ta
union all
select a,b from tb