sql问题急用!求大神

lyf_xx 2013-05-07 05:06:25
sql 语句:

select sum(select count(bu.course)*dc.period from px_course_user as bu inner join px_course as dc ON bu.course = dc.id group by bu.course) as num from dual

错误:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select count(bu.course)*dc.period from px_course_user as bu
inner join px_cour' at line 2
...全文
39 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
wwwwb 2013-05-07
  • 打赏
  • 举报
回复
SELECT SUM(AA) FROM ( SELECT COUNT(bu.course)*dc.period AS AA FROM px_course_user AS bu INNER JOIN px_course AS dc ON bu.course = dc.id GROUP BY bu.course) A

56,678

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧