Saturday, February 25, 2012

Null values

How can I replace null value of a column in a query
with something like 'TEST'
for eg. if I run the query
select contract_num, prodid from product
if the contract_num is null, it should return 'TEST'
instead of NULL. how can I do so?
Thank you,
-Loretta
On Tue, 17 Aug 2004 15:24:44 -0700, Loretta wrote:

>How can I replace null value of a column in a query
>with something like 'TEST'
>for eg. if I run the query
>select contract_num, prodid from product
>if the contract_num is null, it should return 'TEST'
>instead of NULL. how can I do so?
>Thank you,
>-Loretta
Hi Loretta,
SELECT COALESCE(contract_num, 'TEST')
Best, Hugo
(Remove _NO_ and _SPAM_ to get my e-mail address)
|||Hugo,
This helps, thanks much!
-Loretta

>--Original Message--
>On Tue, 17 Aug 2004 15:24:44 -0700, Loretta wrote:
>
>Hi Loretta,
>SELECT COALESCE(contract_num, 'TEST')
>Best, Hugo
>--
>(Remove _NO_ and _SPAM_ to get my e-mail address)
>.
>

No comments:

Post a Comment