Re: Return select statement with sql case statement

Поиск
Список
Период
Сортировка
От hmidi slim
Тема Re: Return select statement with sql case statement
Дата
Msg-id CAMsqVxsqXZ=DXZrn-gDXgpkGLrFpTpi5Ab2Ky9nKD7Kd1n_uXA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Return select statement with sql case statement  (Ron <ronljohnsonjr@gmail.com>)
Ответы Re: Return select statement with sql case statement  (legrand legrand <legrand_legrand@hotmail.com>)
Re: Return select statement with sql case statement  (Ron <ronljohnsonjr@gmail.com>)
Список pgsql-general
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

В списке pgsql-general по дате отправления:

Предыдущее
От: Andy Colson
Дата:
Сообщение: Re: pg_dump out of memory
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Unable to Connect to DB Instance