SELECT * FROM (SELECT * from table where isDel = 0 ORDER BY createTime DESC limit 10) t GROUP BY id ;
注意,需要加limit ,否则语句不会生效(为什么?)
SELECT * FROM (SELECT * from table where isDel = 0 ORDER BY createTime DESC limit 10) t GROUP BY id ;
注意,需要加limit ,否则语句不会生效(为什么?)