srikotesh
asked on
how can i write mysql query in an effective way
HI Experts,
How can i write below query in simple and effective way:
query:
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
Ex:
i passed 236283
parents are :236282--->parentof(236282 )--->23628 1
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.
How can i write below query in simple and effective way:
query:
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
Ex:
i passed 236283
parents are :236282--->parentof(236282
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.