本文共 556 字,大约阅读时间需要 1 分钟。
5 rows in set
> select a1.* from a a1 right join (select max(id) id from a group by name) a2 on a1.id = a2.id where a1
.id is not null; +----+------+--------------+ | id | name | descri | +----+------+--------------+ | 3 | a3 | 我是a3 | | 4 | a1 | 我是第二个a1 | | 5 | a2 | 我是第二个a2 | +----+------+--------------+ 3 rows in set转载地址:http://qybga.baihongyu.com/