Null Conversion

From: Mike Withers <M(dot)withers(at)uws(dot)edu(dot)au>
To: pgsql-general(at)postgresql(dot)org
Subject: Null Conversion
Date: 2001-08-15 01:16:38
Message-ID: 3.0.32.20010815111637.01b9ae30@sovereign.macarthur.uws.edu.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Can anyone tell me how I might convert a null attribute value into a zero
attribute value such that it can be multiplied in a query.

In Oracle I could do:

sal*12*NVL(COMM, 0) AS "Annual Income"

where COMM is an attribute (a salesman commission, in an employes table)
which has null values. This allows null commissions for non salesmen to
give a zero calculated value. The NVL converts a null into zero.

Thanks in anticipation
Mike Withers
University of Western Sydney
Australia

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jason Turner 2001-08-15 01:20:03 Re: Null Conversion
Previous Message Geoffrey Gallaway 2001-08-15 00:59:09 Re: PGSQL Intro & Concepts PDF