标签:union all item har each convert span style 效果 完全
1:Union语句: 把两个结果合为一体(但是完全重复的数据会去掉)
Eg1: select name, age, ‘学生无工资’ from student
union
select name, age, sal from teacher
Eg2: select top 2 CONVERT(varchar(20),itemId) itemid, fee, addDate from Orders
union
select ‘合计‘,SUM(fee),GETDATE() from (select top 2 fee from Orders) a
2:Union All (重复的数据不会去掉)
工资合计效果:Select name, sal from teacher
union all
select ‘工资合计’, sum(sal) from teacher
标签:union all item har each convert span style 效果 完全
原文地址:http://www.cnblogs.com/enamorbreeze/p/6866887.html