From: | "Ian Harding" <ianh(at)tpchd(dot)org> |
---|---|
To: | <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Auomatic numbering, replacing nulls and IF |
Date: | 2002-03-20 16:03:52 |
Message-ID: | sc98426c.029@mail.tpchd.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
ISNULL (T-SQL)
Replaces NULL with the specified replacement value.
Syntax
ISNULL(check_expression, replacement_value)
Arguments
check_expression
Is the expression to be checked for NULL. check_expression can be of any type.
replacement_value
Is the expression to be returned if check_expression is NULL. replacement_value must have the same type as check_expresssion.
Return Types
Returns the same type as check_expression.
Remarks
The value of check_expression is returned if it is not NULL; otherwise, replacement_value is returned.
Ian A. Harding
Programmer/Analyst II
Tacoma-Pierce County Health Department
(253) 798-3549
mailto: iharding(at)tpchd(dot)org
>>> Thomas Lockhart <thomas(at)fourpalms(dot)org> 03/20/02 07:14AM >>>
...
> 2) The ISNULL function in both Oracle and MS-SQL takes 2 numbers and returns
> the second if the first is null, otherwise it returns the first. ISNULL in
> Postgres seems to be something quite different. Before I go writing my own
> function to do it, is there one already?
Look at COALESCE(). Does ISNULL() actually do something different in
Oracle and M$SQL? I'm curious because our definition conforms to the
SQL9x standard, and those databases claim to generally conform also.
- Thomas
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?
From | Date | Subject | |
---|---|---|---|
Next Message | Thomas Lockhart | 2002-03-20 16:04:39 | Re: Bad timestamp external representation '2001-05-11 |
Previous Message | Ian Harding | 2002-03-20 15:59:48 | Re: SQL Server performing much better?!?! |