Skip to content

Coalesce with a conditional expression

The following query works when executed in SequelPro:

But in Hibernate, I keep getting a syntax error for the below:

The syntax error is due to the coalesce function. I can’t find any online resources about how to use an expression inside coalesce.

Advertisement

Answer

What are you trying to do? An explicit case would at least provide clarity:

User contributions licensed under: CC BY-SA
8 People found this is helpful