当前位置:Gxlcms > 数据库问题 > MySQL获取最新一条记录

MySQL获取最新一条记录

时间:2021-07-01 10:21:17 帮助过:61人阅读

* FROM table_name AS ta WHERE ta.唯一键 = ( SELECT max( tb.唯一键 ) FROM table_name AS tb WHERE ta.判断重复的列 = tb.判断重复的列 );

方法二:

select  b.* from (select a.* from tableA a order by a.create_time desc) tableB b group by b.判断重复的列;

 

MySQL获取最新一条记录

标签:获取   nbsp   group   max   rgb   判断   create   div   esc   

人气教程排行