RE: Problem with NULL values
Posted in 2000
Rekaish Bhardwaj — — source: Informix-list mailing list archive (1991-1998)
I think you have to do it in two hits. Try
SELECT ordernro, quantity, sent, (quantity - sent ) as 'q_left'
FROM orders
WHERE sent is not null
UNION
SELECT ordernro, quantity, sent, (quantity) as 'q_left'
FROM orders
WHERE sent is null
Cheers
Rekaish
-----Original Message-----
From: Colin Thu [mailto:ly-cong.thu@pp.inet.fi]
Sent: 12 April 2000 11:06
To: informix-list@iiug.org
Subject: Problem with NULL values
Dear friends!
I have some problem with my Query (SQL). It's about NULL values.
SELECT ordernro, quantity, sent, (quantity - sent ) as 'q_left'
FROM orders
So, If sent = NULL then (quatity - sent) is not "quantity". It'll become
NULL too. So, I need the real value for "q_left".
Thanks for people =P