假設我有以下Oracle表,我想the last (aka max) entry by aGroup and day where the timepart of dateTime in less than 00:00:15
(每日應提取爲dateTime
日期部分)如何獲得一天從一個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
它是由aGroup AND日 – statquant
_「我不知道如何從dateTime提取日期」_ - http://www.google.com/search?q=oracle+sql+date+functions – CBroe