1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
SELECT at2f.at2fcodefouarpe
, at2f.at2fdatcap
, at2f.at2fdatcatpre
CASE
WHEN to_char(SYSDATE, 'YYYY-MM-DD') <= at2f.at2fdatcatpremin
THEN at2f.at2fdatcatpremin
WHEN to_char(SYSDATE, 'YYYY-MM-DD') < at2f.at2fdatcatpremax
AND to_char(SYSDATE, 'YYYY-MM-DD') > at2f.at2fdatcatpremin
THEN at2f.at2fdatcatpremax
WHEN to_char(SYSDATE, 'YYYY-MM-DD') >= at2f.at2fdatcatpremax
THEN at2f.at2fdatcatpremax
END ColonneCase
, at2f.at2fdatcatpremax
, at2f.at2fdatcatpremin
, at2f.at2fcodeucarpe
FROM at2f_arpefop at2f
WHERE at2f.at2fflagmaxetatembal = 'O'
AND at2f.at2fflagmaxindproachat = 'O' |
Partager