首页 > 数据库技术 > 详细

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

时间:2020-07-10 20:58:04      阅读:201      评论:0      收藏:0      [点我收藏+]

 

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;

 

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

原文:https://www.cnblogs.com/toufajiantuzhongbuhui/p/13280298.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!