我在 Mysql 中遇到以下错误:
**错误:错误代码:1064。您的 SQL 语法有误;检查与您的 MySQL 服务器版本相对应的手册,了解在第 11 行的 ')' 附近使用的正确语法 **
select e.user_id,sum(total_points) Total_points_earned from
(select e.*,round(amount/points ,0)total_points from
(select d.*, case when product_id=1 then 5
when product_id=2 then 2
when product_id=3 then 5
else 0
end as points from
(select c.userid,c.product_id,sum(price) amount from
(select a.*,b.price from sales a join product b on .product_id=b.product_id)c
group by userid,product_id)d)e)f
group by userid,product_id)
有人可以帮我吗?
查询应该成功运行。