从数据库中查找最新日期 [英] find latest date from database
本文介绍了从数据库中查找最新日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想从数据库中查找最新日期.我的日期栏中有20个日期.但是我想从数据库中的所有其他日期中找到最新的(较新的)日期.那我该怎么办?
请帮忙...
谢谢...
Mitesh
解决方案
您可以使用T-SQL函数^ ]
SELECT MAX(mdate) FROM mtbl
您可以使用max() ^ ]
例如:从yourTableName中选择SELECT MAX(您的日期列);
您可以执行以下SQL命令:
从NameOfTheDatabaseColumn中选择MAX(NameOfTheDateFieldColumn);
i want to find latest date from the database. there is 20 dates in my date column. but i want to find date which is latest(newer) from all other dates in database. so how can i do ?
please help...
Thankss...
Mitesh
解决方案
You can use the T-SQL function MAX[^]
SELECT MAX(mdate) FROM mtbl
You can use max() http://sqlforeverydb.blogspot.in/2012/04/sql-max-function-mysql.html[^]
eg: SELECT MAX(your date column) FROM yourTableName;
You can execute the following SQL Command:
SELECT MAX(NameOfTheDateFieldColumn) FROM NameOfTheDatabaseColumn;
这篇关于从数据库中查找最新日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文