【原】sql 查询结果合为一行

时间:2014-05-07 21:06:57   收藏:0   阅读:374

SELECT COUNT(*) AS AllCount,t.AssignedCount,(COUNT(*)-t.AssignedCount) AS UnassignedCount
FROM 药品表
jOIN
(
SELECT COUNT(*) AS AssignedCount
FROM 质量分析分配表 
)as t on 1=1
group by t.AssignedCount

 

bubuko.com,布布扣

【原】sql 查询结果合为一行,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!