CREATE TABLE MRE_UHAUL as (
select OUTBOUND, INBOUND, vehicle_size, rental_date as start_date
,TO_CHAR(TO_DATE((
LEAD(Rental_date) over
(partition by OUTBOUND, INBOUND, vehicle_size
order by OUTBOUND, INBOUND, vehicle_size, rental_date
)),
'YYYYMMDD')-1, 'YYYYMMDD') as end_date
,Rate
from ( select OUTBOUND, INBOUND, vehicle_size, rental_date, Avg(RATE) as RATE
from mre_competitor_data
where competitor='UHAUL'
group by OUTBOUND, INBOUND, vehicle_size, rental_date)
where rental_date <= (select cpd from mre_system_parameters)
);
当我尝试运行它时,它说:
SQL错误:ORA-00932:数据类型不一致:预期日期为NUMBER 00932. 00000-“数据类型不一致:预期的%s得到了%s”