
算和后合并表
圈圈圈小明
这个作者很懒,什么都没留下…
展开
-
一个主表连接二个未算和的附表,通过临时表的方式
分别测试待合并的数据详细SQL:SELECT sum(s.Count) as ssumCount,s.CustormerId as scId from recordsuccessbycustomer as s group by s.CustormerId SELECT sum(f.Count) as fsumCount,f.CustormerId as fcId from recordfaile...原创 2018-02-11 22:56:17 · 400 阅读 · 0 评论 -
列转行然后合并
原始数据转化后的数据源代码:SELECT recordbytunnel.ttype, recordbytunnel.tsequense, tunnelId, MAX(CASE DataType WHEN 1 THEN RowCount ELSE 0 END) AS '发送总数Cmpp', MAX(CASE DataType WHEN 2 THEN RowCount ELSE 0 END) AS '...原创 2018-02-12 21:45:33 · 877 阅读 · 0 评论