mysql不同查询条件用一条查询语句完成

现在有两条查询语句
select date_format(time,'%Y-%m-%d') as title,count(*) as imm_num from meter INNER JOIN user USING(time) WHERE meter.userId=user.id group by title order by title desc;
和 select date_format(time,'%Y-%m-%d') as title,count(*) as num WHERE 1=1 group by title order by title desc;
怎么合并成一条

可以用union 但你两条查询语句 查询的列不同

可以这样:
把第一个select语句命名为a,第二条为b
select a.xx,a.yy, b,xxx,b,yyy from (select ...)a, (select ...)b where ... ;

即可得到你要的结果

不行,第一句内连接 第二句没有内连接 前提条件都不一样 写不成 勉强写出来也是错的而且数据少了可能发现不了 数据一多很容易暴露