Actually, I need the use of case because based on the numberOfPremiumDays
there are different type of treatment:
select numberOfPremiumDays
case when numberOfPremiumDays = date_part('day',
('2018-11-05'::timestamp) - ('2018-11-01'::timestamp)) then
select product_id,
premium_price,
period_price
from product
where occupation_type_id = 1
group by product_id, occupation_type_id
else
select product_id,
classic_price,
period_price
from product1
where occupation_type_id = 1
group by product_id, occupation_type_id
- Return select statement with sql case statement hmidi slim
- Re: Return select statement with sql case statement Ron
- Re: Return select statement with sql case state... hmidi slim
- Re: Return select statement with sql case s... legrand legrand
- Re: Return select statement with sql case s... Ron
- Re: Return select statement with sql ca... Adrian Klaver
- Re: Return select statement with s... Ron
- Re: Return select statement wi... David G. Johnston
