Is there any substitute for ifnull()

798 Views Asked by At

I have a query for mysql where ifnull() is used.i want to convert it into ejb-ql. Problem here is that i dont find any substitute equivalent to ifnull() in ejb.

For eg:

ifnull(columnname,' ') as newcoulmn
1

There are 1 best solutions below

1
On BEST ANSWER

You may try

  coalesce(columnname, ' ') as newcolumn

since coalesce is widely supported function when ifnull is MySql specific one