Guest_imported
New member
- Jan 1, 1970
- 0
Hi everyone,
I've got a problem...
...I'm searching for ab way to make the following sql-statement easier:
select id, MIN(nvl(min_date,'1.1.9999')) min_date
from (
select id, expiry_date min_date, expiry_date, retest_date from item
union
select id, retest_date min_date, expiry_date, retest_date from item
)
group by id
order by min_date asc;
The statement should select the items with the min expiry date resp. min retest date.
Any suggestions?
I've got a problem...
...I'm searching for ab way to make the following sql-statement easier:
select id, MIN(nvl(min_date,'1.1.9999')) min_date
from (
select id, expiry_date min_date, expiry_date, retest_date from item
union
select id, retest_date min_date, expiry_date, retest_date from item
)
group by id
order by min_date asc;
The statement should select the items with the min expiry date resp. min retest date.
Any suggestions?