How do I get the current year using SQL on Oracle?

前端 未结 6 2324
清酒与你
清酒与你 2020-12-04 14:21

I need to add the current year as a variable in an SQL statement, how can I retrieve the current year using SQL?

i.e.

  BETWEEN 
    TO_DATE(\'01/01/**         


        
6条回答
  •  旧时难觅i
    2020-12-04 14:54

    Yet another option would be:

    SELECT * FROM mytable
     WHERE TRUNC(mydate, 'YEAR') = TRUNC(SYSDATE, 'YEAR');
    

提交回复
热议问题