Sql语句怎么改为Hql语句
SELECTu.user_name'客户名称',count(u.user_name)'订单数量',sum(o.number*g.price)'总计金额',sum(o.nu...
SELECT
u.user_name '客户名称',
count(u.user_name) '订单数量',
sum(o.number * g.price) '总计金额',
sum(o.number) '总计数量'
FROM
user_table u,
goods g,
order_table o
WHERE
u.user_id = o.uid
AND g.goods_id = o.gid
GROUP BY
g.goods_name 展开
u.user_name '客户名称',
count(u.user_name) '订单数量',
sum(o.number * g.price) '总计金额',
sum(o.number) '总计数量'
FROM
user_table u,
goods g,
order_table o
WHERE
u.user_id = o.uid
AND g.goods_id = o.gid
GROUP BY
g.goods_name 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询