How can i write below query in simple and effective way:
Select CI_ID,@pv:=CI_parent_CI as parentid from (select CI_ID,CI_parent_CI from master order by CI_ID desc) as master join (select @pv:=236283) tmp where CI_ID=@pv;
the above query will give list of ids which are parent to 236283
i passed 236283
parents are :236282--->parentof(236282)--->236281
is there any alternative way to get this result,why because i have to convert this query to hibernate hql.
the above query will not support in hibernate.