我有 2 个日期字段,我试图在 where 子句中使用 OR。举个例子,
Select customer_records.customer_id, customer_records.join_date, rejected_customers.rejected_date, status_lookup.status_description
From customer_records, rejected_customers, status_lookup
Where status_lookup.status_id(+) = customer_records.status_id and customer_records.customer_id = rejected_customers.customer_id
and (customer_records.join_date between to_date('01-10-2012','dd-mm-yyyy') and to_date('01-11-2012','dd-mm-yyyy') or rejected_customers.rejected_date between to_date('01-10-2012','dd-mm-yyyy') and to_date('01-11-2012','dd-mm-yyyy')
所以,基本结果应该是,当加入日期或被拒绝的日期落入我的日期字段时,我想要 customer_id。我似乎无法让它工作,任何帮助表示赞赏,谢谢!