Re: isnull() function in pgAdmin3

Поиск
Список
Период
Сортировка
От Thomas Kellerer
Тема Re: isnull() function in pgAdmin3
Дата
Msg-id nsgljr$ip5$1@blaine.gmane.org
обсуждение исходный текст
Ответ на isnull() function in pgAdmin3  (dudedoe01 <marsalanaq@gmail.com>)
Список pgsql-general
dudedoe01 schrieb am 27.09.2016 um 19:04:
> I am trying to emulate the isnull() function used in MySQL into postreSQL. I
> have tried different ways such is null but it's not producing the results
> desired. I am doing a data migration from MySQL into postgreSQL and need
> help with the isnull() in pgAdmin3.
>
> Any assistance provided would be greatly appreciated.
>
> Thanks,
>
> In MySQL:
>
> (case
>             when
>                 ((`s`.`Funding_Date` = '')
>                     and (isnull(`s`.`Actual_Close_Date`)
>                     or (`s`.`Actual_Close_Date` = '')))
>             then
>                 'RPG_INV'
>             when
>                 ((isnull(`s`.`Funding_Date`)
>                     or (`s`.`Funding_Date` <> ''))
>                     and ((`s`.`Actual_Close_Date` = '')
>                     or isnull(`s`.`Actual_Close_Date`)))
>             then
>                 'Builder_Inventory'
>             else 'Owner_Inventory'
>         end) AS `Lot_Status`,
>

Unrelated, but: why are you storing DATEs in VARCHAR columns?

A migration might be a good moment to clean up the data model and store DATEs in a DATE (or TIMESTAMP) column.



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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: isnull() function in pgAdmin3
Следующее
От: Kevin Grittner
Дата:
Сообщение: Re: isnull() function in pgAdmin3