子句里面的group 和 order冲突 应该怎么修改

浏览:871 发布日期:2017/05/27 分类:求助交流
select a.*,b.*
from goods a left join defind_14 b on a.common_id = b.goods_id
where exists(select common_id from goods where a.common_id=common_id group by common_id having min(id)=a.id)
order by a.id desc

主要要实现 group分组后 获取最小的id 进行排序
最佳答案
评论() 相关
后面还有条评论,点击查看>>