1
select count(1)2
into l_line_num --l_number_of_day3
from hek_om_pop_validity_all4
where inventory_item_id = l_item_id5
and ((start_date <= sysdate6
and end_date >= sysdate)7
or (start_date <= sysdate and end_date is null));修改后:
1
select count(1)2
into l_line_num --l_number_of_day3
from hek_om_pop_validity_all4
where inventory_item_id = l_item_id5
and start_date <= sysdate6
and nvl(end_date, sysdate + 1) >= sysdate;