怎么将这个oracle的sql语句转换成hibernate的hql语句?
selectc.id,c.name,nvl(sum(h.count*w.price),0)asmoneyfromt_clientcleftjoint_historyhon...
select c.id,c.name,nvl(sum(h.count*w.price),0) as money from t_client c left join t_history h on c.id = h.clientid left join t_wares w on w.id = h.waresidgroup by c.id,c.name
展开
1个回答
2013-07-22
展开全部
用返回map的方式吧。
select c.id,c.name,nvl(sum(h.count*w.price),0) as money
from t_client c left join t_history h on c.id = h.clientid left join t_wares w on w.id = h.waresid
group by c.id,c.name
select new map(c.id,c.name,nvl(sum(h.count*w.price),0) as money)
from Client c left join c.History h left join Wares w
group by c.id, c.name
大概这样,暂时没环境测试。
select c.id,c.name,nvl(sum(h.count*w.price),0) as money
from t_client c left join t_history h on c.id = h.clientid left join t_wares w on w.id = h.waresid
group by c.id,c.name
select new map(c.id,c.name,nvl(sum(h.count*w.price),0) as money)
from Client c left join c.History h left join Wares w
group by c.id, c.name
大概这样,暂时没环境测试。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询