开发者

Oracle: Selecting all records where the table's date fields' hour and minute value are set to certain value

开发者 https://www.devze.com 2023-01-07 15:34 出处:网络
I have a table in a Oracle database containing a date field EXPIRYDATE. I would need to select all records from the table, where the hour and minute por开发者_运维问答tion of the date field are set to

I have a table in a Oracle database containing a date field EXPIRYDATE. I would need to select all records from the table, where the hour and minute por开发者_运维问答tion of the date field are set to 0 (i.e. midnight). How can I achieve this?

I tried with the extract function (http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions050.htm), but apparently it only accepts YEAR, MONTH or DAY as parameters for a date field.


You could do this:

WHERE TO_CHAR(expirydate,'HH24MI') = '0000'
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号