Re: change null to 0 in SQL script

From: "Karl Raven" <lcaasia(at)pd(dot)jaring(dot)my>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: change null to 0 in SQL script
Date: 2002-01-05 20:54:07
Message-ID: a17p72$bne$1@news.tht.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

thanks
will try it..

"ThomasR" <trx(at)wtal(dot)de> wrote in message news:3C360816(dot)1080103(at)wtal(dot)de(dot)(dot)(dot)
> Karl Raven wrote:
>
> > I like to change a null value of a query to 0 in the SQL script. I know
how
> > to do it in MS-SQL server and MS-Access but those commands does not work
in
> > pg-sql.
> >
> > Anyone has any ideas?
> >
> > Thanks
> >
>
> I think the following should work:
>
> select coalesce( my_attrib, 0 ) from my_tab
>
> Thomas
>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Peter Eisentraut 2002-01-06 05:22:10 Re: simple? join
Previous Message Andrew Perrin 2002-01-05 20:37:54 Which date/paper pairs are NOT represented?