Oracle: Selecting all records where the table's date fields' hour and minute value are set to certain value
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'
精彩评论