Re: isnull() function in pgAdmin3 - Mailing list pgsql-general

From Ken Tanzer
Subject Re: isnull() function in pgAdmin3
Date
Msg-id CAD3a31UsQ_JT7HZ_4+7fRrKF+SW8emXhbiGGjNbQRAMwPuWdQQ@mail.gmail.com
Whole thread Raw
In response to Re: isnull() function in pgAdmin3  (dudedoe01 <marsalanaq@gmail.com>)
List pgsql-general
On Mon, Oct 3, 2016 at 6:39 AM, dudedoe01 <marsalanaq@gmail.com> wrote:
What is the most feasible way to emulate the below MySQL function into
postgreSQL. Since the isnull() function is no longer supported in 9.6
version. I have tried every trick in the hat to get the desired results.
Still 'RPG INV' doesn't show only the other two then options show up.

(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`




Hi.  Over the years I have gotten a lot of patient assistance from this mailing list, for which I am abundantly grateful.  In light of that, I offer the following "translations," which are specifically in response to your question about emulating the SQL above:

and (isnull(`s`.`Actual_Close_Date`)
--> and (`s`.`Actual_Close_Date` IS NULL)

((isnull(`s`.`Funding_Date`)
--> (`s`.`Funding_Date` IS NULL)

or isnull(`s`.`Actual_Close_Date`)))
-->or (`s`.`Actual_Close_Date` IS NULL)))

HTH, and Cheers.

Ken




 
--
View this message in context: http://postgresql.nabble.com/isnull-function-in-pgAdmin3-tp5923122p5924161.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



--
AGENCY Software  
A Free Software data system
By and for non-profits
(253) 245-3801

learn more about AGENCY or
follow the discussion.

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Problems with pg_upgrade after change of unix user running db.
Next
From: Adrian Klaver
Date:
Subject: Re: isnull() function in pgAdmin3