当前位置:数据库 > MySQL >>

mysql 查询问题

SELECT distinct c.imsi,ct.city_name,cxcg FROM cmcc_tbl c left join city_tbl ct on c.imsi=ct.code_num left join (select imsi,count(id) as cxcg from cmcc_tbl group by imsi) as cs on c.imsi=cs.imsi union all SELECT distinct c.imsi,ct.city_name,cxcg FROM cuni_tbl c left join city_tbl ct on c.imsi=ct.code_num left join (select imsi,count(id) as cxcg from cuni_tbl group by imsi) as cs on c.imsi=cs.imsi 这个查询 我想要 这二条记录汇总成一条,因为我要cxcg 的总数的
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,