假设我有以下 Oracle 表并且我想要the last (aka max) entry by aGroup and day where the timepart of dateTime in less than 00:00:15
(应该将日期提取为 的日期部分dateTime
)
它的 SQL 查询是什么(我不知道如何从 dateTime 中提取日期)?
dateTime aGroup
2011-01-01 00:00:12 a
2011-01-01 00:00:31 a
2012-01-01 00:00:09 a
2012-01-01 00:00:03 a
2011-01-01 00:00:06 b
2011-01-01 00:00:14 b
2011-01-01 00:00:16 b
2012-01-01 00:00:16 b
2012-01-01 00:00:11 b
这是我期望的结果
dateTime aGroup
2011-01-01 00:00:12 a
2012-01-01 00:00:09 a
2011-01-01 00:00:14 b
2012-01-01 00:00:11 b