SQL 转换成 HQL
3个回答
2011-06-08
展开全部
先,我要给你提点建议,你这个查询不用那么麻烦的,sql不是有group by吗,用那个即可
SELECT merchant_area as name,count(*) as num
FROM merchant
GROUP BY merchant_area
改成HQL为
SELECT m.merchantArea AS name,COUNT(m.ID) AS num FROM Merchant AS m GROUP BY m.merchantArea
SELECT merchant_area as name,count(*) as num
FROM merchant
GROUP BY merchant_area
改成HQL为
SELECT m.merchantArea AS name,COUNT(m.ID) AS num FROM Merchant AS m GROUP BY m.merchantArea
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询