'HQL'에 해당되는 글 1건
coalesce() is the equivalent to the nvl() :: 2010/02/16 19:01
오라클의 NVL() 함수에 해당하는 Hibernate HQL 함수로 coalesce()가 있다.
coalesce(a, b)는 a가 null이 아니면 a를 반환하고, null일 경우 b를 반환한다.
예제)
from Table where col1 = coalesce(:par1, 'asdf')
from Table where current_date() <= coalesce(endDate, current_date())
coalesce(a, b)는 a가 null이 아니면 a를 반환하고, null일 경우 b를 반환한다.
예제)
from Table where col1 = coalesce(:par1, 'asdf')
from Table where current_date() <= coalesce(endDate, current_date())

