标签:bsp cti sap col date rgba func UNC select
/*
返回年
YEARS_BETWEEN(<date_1>, <date_2>)
返回两个日期之间年份
*/
SELECT YEAR (TO_DATE (‘2011-05-30‘, ‘YYYY-MM-DD‘)) FROM DUMMY; --返回2 SELECT YEARS_BETWEEN(TO_DATE(‘2001-01-01‘), TO_DATE(‘2003-03-14‘)) FROM DUMMY; --返回0,不满1年 SELECT YEARS_BETWEEN(TO_DATE(‘2004-01-01‘), TO_DATE(‘2003-03-14‘)) FROM DUMMY; --返回-1 SELECT YEARS_BETWEEN(TO_DATE(‘2004-03-14‘), TO_DATE(‘2003-03-14‘)) FROM DUMMY;
标签:bsp cti sap col date rgba func UNC select
原文地址:https://www.cnblogs.com/tangToms/p/13939799.html