Reputation: 135
What would be the output?? And please explain the below coalesce statement.
"COALESCE(NULL, :RG) IS NULL"
Upvotes: 0
Views: 30
Reputation: 2525
COALESCE
returns the first not null value, so if you pass 2 arguments and the first is NULL
, you will receive the second one if is not null.
In a where
the espression you pasted is equal to :RG IS NULL
.
Maybe coalesce is here for some compatibility issue? Just a guess.
Upvotes: 0
Reputation: 156928
The coalesce
statement is totally useless. You could also write it like this:
:RG IS NULL
And that simply checks if the :rg
parameter passed in is null or not. This would be placed in a where
clause or a case
switch.
Upvotes: 1