Thread: convert NULL into a value
Hi,
There is a function on the Oracle. That is NVL(field, 0) to convert null into a value (e.g. ZERO).
Can I use this function on the PostgreSQL??
Thank you for your help!!
Regards,
JONATHAN MAN
--- Jonathan Man <jman@equityunderwriters.com.hk> wrote: > Hi, > > There is a function on the Oracle. That is > NVL(field, 0) to convert null into a value (e.g. > ZERO). > > Can I use this function on the PostgreSQL?? > -- The equivalent function is PostgreSQL is SELECT COALESCE(field,0) regards, ludwig. __________________________________________________ Do you Yahoo!? New DSL Internet Access from SBC & Yahoo! http://sbc.yahoo.com
No, the SQL standard command is COALESCE. --------------------------------------------------------------------------- Jonathan Man wrote: > Hi, > > There is a function on the Oracle. That is NVL(field, 0) to convert null into a value (e.g. ZERO). > > Can I use this function on the PostgreSQL?? > > > Thank you for your help!! > > Regards, > > JONATHAN MAN -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001+ If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania19073