sign的oracle,oracle sign
select user_name,real_name,amountdesc,
max(decode(TO_CHAR(to_date(a.sendtime,'YYYYMMDD'),'iw'),decode(sign(to_char(sysdate,'iw')-4),1,to_char(sysdate,'iw')-4,to_char(sysdate,'iw')-4+53),amount,0)) as 上四周,
max(decode(TO_CHAR(to_date(a.sendtime,'YYYYMMDD'),'iw'),decode(sign(to_char(sysdate,'iw')-3),1,to_char(sysdate,'iw')-3,to_char(sysdate,'iw')-3+53),amount,0)) as 上三周,
max(decode(TO_CHAR(to_date(a.sendtime,'YYYYMMDD'),'iw'),decode(sign(to_char(sysdate,'iw')-2),1,to_char(sysdate,'iw')-2,to_char(sysdate,'iw')-2+53),amount,0)) as 上二周,
max(decode(TO_CHAR(to_date(a.sendtime,'YYYYMMDD'),'iw'),decode(sign(to_char(sysdate,'iw')-1),1,to_char(sysdate,'iw')-1,to_char(sysdate,'iw')-1+53),amount,0)) as 上一周,
max(decode(TO_CHAR(to_date(a.sendtime,'YYYYMMDD'),'iw'),to_char(sysdate,'iw'),amount,0)) as 當前周
from v_stat_xmlamount a
group by user_name,real_name,amountdesc
order by 3,8 desc
來自 “ ITPUB博客 ” ,鏈接:http://blog.itpub.net/185279/viewspace-624196/,如需轉載,請注明出處,否則將追究法律責任。
總結
以上是生活随笔為你收集整理的sign的oracle,oracle sign的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 逻辑io 物理io oracle,Ora
- 下一篇: linux 命令last -x,Linu