mysql 多条查询语句_mysql查询语句 多条合并

展开全部

最笨的方式就是把这么多条查询结果当成表,然后select全部,虽然笛卡尔积,32313133353236313431303231363533e4b893e5b19e31333332643332但是每个查询都只有一条记录。select * from

(select count(t1.fXM)as A1 from KJ_KJHDRYMXB t1 where t1.fDW = 'a部' )a,

(select count(t2.fJSZW)AS A2 from KJ_KJHDRYMXB t2 where  t2.fJSZW = '项目人员' and t2.fDW = 'a部')b,

(select count(t3.fJSZW)AS A3 from KJ_KJHDRYMXB t3 where (t3.fJSZW = '服务人员'or t3.fJSZW = '管理人员') and t3.fDW = 'a部')c,

(select count(t31.fXB)AS A4 from KJ_KJHDRYMXB t31 where t31.fXB = '女' and t31.fDW = 'a部')d

(select count(t4.fZC)AS A5 from KJ_KJHDRYMXB t4 where (t4.fZC = '高级职称'or t4.fZC = '中级职称')and t4.fDW = 'a部')d,

(select count(t5.fXM)AS A6 from KJ_KJHDRYMXB t5 where  t5.fDW = 'a部')e

(select count(t6.fXL)AS A7 from KJ_KJHDRYMXB t6 where t6.fXL = '博士'and t6.fDW = 'a部')f

(select count(t7.fXL)AS A8 from KJ_KJHDRYMXB t7 where t7.fXL = '硕士' and t7.fDW = 'a部')g

(select count(t8.fXL)AS A9 from KJ_KJHDRYMXB t8 where t8.fXL = '本科'and t8.fDW = 'a部')h

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值