-1

I have to check null against the entry.
I have address in person object, so I have tried to fetch it like below.

select new map(person.id as id,
               case when person.address is not empty 
               then person.address.city end as city) 
from Person person where person.id=:id

Does case..when work with where clause

But there is no error and result.

thilo
  • 127
  • 1
  • 3
  • 11

1 Answers1

0

try this:

select new map(person.id as id,coalesce(person.address,person.address.city )as city) from Person person
renis
  • 171
  • 7
  • 16