Hi,
I'm using hibernate 3.2.5 and I would like some advice on the following use case: I want to order a query based on "is null" of some columns, 2 columns is null gives an earlier occurence than 2 columns not null.
In oracle 10.? I can do:
Code:
select *
from ( select *
from tbl_eqi eqi
order by case when pos_ben is null and MAR_BEN is null then 0
when POS_BEN is null and MAR_BEN is not null then 1
when POS_BEN is not null and MAR_BEN is null then 2
when POS_BEN is not null and MAR_BEN is not null then 3
end
)
Is there an equivalent in HQL or should i use native sql or some java manipulation?
regards,
Jeroen.