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';

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM