SELECT titol, data_prestec FROM if_llibres, if_llibre_prestec
WHERE if_llibre_prestec.ubicacio = if_llibres.ubicacio
AND data_devolucio IS NULL
AND data_prestec <= date_sub(current_date(),interval 30 day);
Oracle中没有DATE_SUB()
函数。您可以将其表达为:
select
titol,
data_prestec
from if_llibres il
inner join if_llibre_prestec ilp
on ild.ubicacio = il.ubicacio
where
data_devolucio is null
and data_prestec <= current_date - interval '30' day;