SQL查询最大或最新的一条数据

 

1    select tcfi.* from t_cust_face_identify tcfi where tcfi.cust_no = '2004081422003482994' order by tcfi.create_time desc limit 1;

 

 

1 select * from table where id=(select MAX(id) from table )

 

1 应该加主键条件吧:select * from table a where id=(select MAX(id) from table where key =a.key ) and key ='n';

 

posted on 2020-07-10 17:21  头发渐秃终不悔  阅读(7799)  评论(0编辑  收藏  举报

导航