选择最大日期- [英] select max date-

查看:67
本文介绍了选择最大日期-的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友
我有这个要求.

2010-04-27 13:01:34.187
2010-04-28 11:48:21.000
2010-05-20 16:56:15.937
2010-05-20 16:57:24.873
2010-08-13 14:01:29.310

从这些给定日期开始,我必须从特定日期中选择最大日期
意味着如果我在同一日期但在不同时间在数据库中有条目,则该日期应该是最大时间.

结果应该是.
2010-04-27 13:01:34.187
2010-04-28 11:48:21.000
2010-05-20 16:57:24.873
2010-08-13 14:01:29.310.

谢谢
varun sareen

Dear friend
i have this requirement.

2010-04-27 13:01:34.187
2010-04-28 11:48:21.000
2010-05-20 16:56:15.937
2010-05-20 16:57:24.873
2010-08-13 14:01:29.310

from these given date i have to select max date from a particular date
means if i have entries in database for same date but at different times then max time should come for that date.

result should be.
2010-04-27 13:01:34.187
2010-04-28 11:48:21.000
2010-05-20 16:57:24.873
2010-08-13 14:01:29.310.

Thanks
varun sareen

推荐答案

如果只有这些列,那么为什么不尝试使用Group By操作.

如果您的表包含其他一些列,并且您想按日期检索最新的行,那么这将有所帮助,
sql-fetch-the-row-哪一个列具有最大价值 [
If you only have these columns, then why don''t you try a Group By operation.
Or
If your table contains some other columns and you want to retrieve the latest row by date, then this will help,
sql-fetch-the-row-which-has-the-max-value-for-a-column[^]


这篇关于选择最大日期-的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆