mysql groupby分组查询
要求的字段不在分组字段内,select 不支持返回该字段时,可以使用关联表查询。
类似这种:select a from t1, (select b from t1 group by b having xxx) as t2 where t1.b = t2.b; 曲线救国。
要求的字段不在分组字段内,select 不支持返回该字段时,可以使用关联表查询。
类似这种:select a from t1, (select b from t1 group by b having xxx) as t2 where t1.b = t2.b; 曲线救国。