mysql groupby分组查询

要求的字段不在分组字段内,select 不支持返回该字段时,可以使用关联表查询。

类似这种:select a from t1, (select b from t1 group by b having xxx) as t2 where t1.b = t2.b; 曲线救国。

posted @ 2021-05-19 11:29  江湖凶险  阅读(437)  评论(0编辑  收藏  举报