日期:2014-05-17 浏览次数:20869 次
SELECT * FROM huiyuan_xinxi WHERE to_char(birday_sr,'yyyy-mm')=to_char(SYSDATE,'yyyy-mm')
SELECT *
FROM HUIYUAN_XINXI
WHERE TO_CHAR(BIRDAY_SR, 'yyyy-mm-dd') <=
TO_CHAR(ADD_MONTHS(SYSDATE, 2), 'yyyy-mm-dd')
AND TO_CHAR(BIRDAY_SR, 'yyyy-mm-dd')>=to_char(SYSDATE,'yyyy-mm-dd')
SELECT *
FROM HUIYUAN_XINXI
WHERE TO_CHAR(BIRDAY_SR, 'yyyy-mm-dd') <=
TO_CHAR(ADD_MONTHS(SYSDATE, 2), 'yyyy-mm-dd')
AND TO_CHAR(BIRDAY_SR, 'yyyy-mm-dd')>=to_char(add_months(SYSDATE,-2),'yyyy-mm-dd')
select * from huiyuan_xinxi
where birday_sr between
trunc(add_months(sysdate,-2),'mm') and last_day(add_months(sysdate,2))