我试图在接下来的12个月内提取所有数据。我唯一能在网上找到的就是" addmonths"但是无法得到它,不确定它是否因为Start_date列中的日期是DD / MM / YYYY?
select number, start_date from wo_table
where start_date between sysdate and addmonths(sysdate,12)
答案 0 :(得分:0)
SELECT "number", start_date
FROM wo_table
WHERE start_date BETWEEN SYSDATE
AND ADD_MONTHS( SYSDATE, 12 );
或者
SELECT "number", start_date
FROM wo_table
WHERE start_date BETWEEN SYSDATE
AND SYSDATE + INTERVAL '1' YEAR;
答案 1 :(得分:-1)
想出来以备将来参考,它有助于其他人:
select number, start_date from wo_table
where start_date between sysdate and sysdate+365
简单:)