Re: JavaDB / Apache Derby equivalent to the SQL Server IsNull, Oracle nvl and MySQL IfNull



James Appleby wrote:
On 10 Aug, 17:19, Thomas Kellerer <FJIFALSDG...@xxxxxxxxxxxxx> wrote:
CASE or NULLIF

http://db.apache.org/derby/docs/10.2/ref/rrefcasenullif.html


Thank you for replying. I had investigated these options and I don't
think they offer what I need.

NULLIF returns a null if meeting a boolean condition, I need to return
0 when it is null.

CASE could give the result but would require the query to be done
twice, once for boolean evaluation and then again to return the
value. If I can only get the value by running the query twice, I
might as well do a union. My hope was that a function existed that
meant I didn't need to do that.

Why would you need to run the Query twice when using CASE?

Can you give an example of what you are trying to do? I'm pretty sure that I could replace Oracle's nvl with a CASE without running a statement twice.

Thomas
.