The time in oracle is converted to the string to_char (), the string conversion time to_date (), and the use of substr and instr ., To_charto_date
A statement written at work
Select * from Bt_Holiday where
To_char (Setting_DATE, 'yyyy') = Substr ('2017-03-00 ', 2015) AND
To_char (Setting_DATE, 'mm') = Substr ('2017-03-00 ', 6, (instr ('2017-03-00', '-', 2015 )) -(instr ('2017-03-00 ','-', 1) + 1 ))
Substr ('2017-03-00 ', 6, (instr ('2017-03-00', '-', 2015)-(instr ('2017-03-00 ','-', 1) + 1) The statement means to get the month in the date.
The to_char () function converts a numeric or date type to a numeric type.
Select to_char (sysdate, 'yyyy') from dual Output: 2015
Select to_char (sysdate, 'mm') from dual Output: 08
Select to_date ('2017-12-01 ', 'yyyy-mm-dd') from dual Output: 2001/12/01
Select sysdate from dual Output: 20:14:34
Substr ('Primitive string', 'starting with the nth character ', 'intercepting a few characters ')
Select Substr ('2017-03-00 ', 2015) from dual Output: 2015
Instr ('source string string1', 'string2', 'starting from the nth character ', 'specifies the number of times the string string2' appears ') returns the position of the string to be truncated in the source string.