首页 > 其他 > 详细

union all 简单用法

时间:2015-05-12 18:26:42      阅读:116      评论:0      收藏:0      [点我收藏+]

select Y.ID,sum(cast(Y.m as int)) as he
from
(select top 10 a.ID,a.AlarmSource as m from dbo.AlarmInfo a
union all
select top 10 B.ID,B.AssetCode as m from dbo.AuxiliaryToolInfo B
)Y
group by Y.ID

 

select top 10 A.* from dbo.AlarmInfo A;
select top 10 B.* from dbo.AuxiliaryToolInfo B

select * from dbo.MES_DataRealtime

union all 简单用法

原文:http://www.cnblogs.com/chengjun/p/4498074.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!