oracle取月的函数,Oracle取统计月的函数

function TjYear(rq IN DATE)return INTEGER

IS

re integer;

BEGIN

if rq is null thenreturn null;

end if;

re:=extract(year from (rq));

if rq>=to_date(re||'1226000000','YYYYMMDDhh24miss') then

re:=re+1;

end if;

return re;

END TjYear;

function TjMonth(rq IN DATE)return INTEGER

IS

s_month integer;

s_day integer;

BEGIN

if rq is null thenreturn null;

end if;

s_month:=extract(month from(rq));

s_day:=extract(day from (rq));

if s_month>=1 and s_month<=11 then

if s_day>=26 then

s_month:=s_month+1;

end if;

elsif s_month=12 then

if s_day>=26 then

s_month:=1;

end if;

end if;

return s_month;

END TjMonth;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值