新聞中心
這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
oracleadd_months函數(shù)的用法詳解
如果需要取上一個月的數(shù)據(jù),并且每天都要進(jìn)行此操作,每次都需要改時間,的確非常的麻煩,所以想到了oracle add_months函數(shù)這個函數(shù)

oracle add_months函數(shù):
oracle add_months(time,months)函數(shù)可以得到某一時間之前或之后n個月的時間
- 如 select add_months(sysdate,-6) from dual;
該查詢的結(jié)果是當(dāng)前時間半年前的時間
- select add_months(sysdate,6) from dual;
該查詢的結(jié)果是當(dāng)前時間半年后的時間
- my examle:
- select distinct(t.mobile) from twaplogon t where to_char(t.logontime,'yyyy-mm')=to_char(add_months(sysdate,-1),'yyyy-mm')
以上就是oracle add_months函數(shù)的使用方法。
分享名稱:oracleadd_months函數(shù)的用法詳解
標(biāo)題路徑:http://fisionsoft.com.cn/article/cdghopo.html


咨詢
建站咨詢
