Received: from ucs.co.za (IDENT:root@www.salestracker.co.za [160.124.114.60]) by hub.org (8.9.3/8.9.3) with ESMTP id JAA44596 for ; Mon, 29 May 2000 09:42:22 -0400 (EDT) (envelope-from gaf@ucs.co.za) Received: from ucspost.ucs.co.za (IDENT:root@mailgw1.ucs.co.za [160.124.114.254]) by ucs.co.za (8.9.3/8.9.3) with ESMTP id PAA18579; Mon, 29 May 2000 15:45:29 +0200 Received: from jhb.ucs.co.za (jhb.ucs.co.za [172.31.1.73]) by ucspost.ucs.co.za (8.9.3/8.7.3) with ESMTP id PAA15893; Mon, 29 May 2000 15:43:58 +0200 Received: from ucs.co.za (IDENT:gaf@pc141.ucs.co.za [172.31.1.141]) by jhb.ucs.co.za (8.9.3/8.8.7) with ESMTP id PAA26753; Mon, 29 May 2000 15:45:58 +0200 Message-ID: <393273EB.225F9DA5@ucs.co.za> Date: Mon, 29 May 2000 15:43:07 +0200 From: Grant Finnemore X-Mailer: Mozilla 4.61 [en] (X11; I; Linux 2.2.12-20 i686) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-sql@postgresql.org CC: Werner Modenbach Subject: Re: adding fields containing NULL values References: <00052913594506.02278@werner.alc.de> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200005/183 Werner, > Umfortunately 'select employee,date,sallary+extras as total' doesn't give the > desired result because 'somevalue + NULL' is considered to be NULL. > Is there any solution for my (small) problem? Try SELECT employee, date, salary + COALESCE(extras, 0) as total FROM ... Regards Grant -- > Poorly planned software requires a genius to write it > and a hero to use it. Grant Finnemore BSc(Eng) (mailto:gaf@ucs.co.za) Software Engineer Universal Computer Services Tel (+27)(11)712-1366 PO Box 31266 Braamfontein 2017, South Africa Cell (+27)(82)604-5536 20th Floor, 209 Smit St., Braamfontein Fax (+27)(11)339-3421 Johannesburg, South Africa