mysql语法查询

时间:2011-09-07 16:16:30

标签: mysql sql

这段代码不会编译,也不会是神奇的SQL Server所做的。有人可以指出错误吗。而且,这是hw,但是赋值是sql-version不可知的,所以它真的没关系。感谢。

SELECT courseNo, section,
SELECT (
  count( * )
  FROM registration, students
 WHERE registration.idno = students.idno
)
FROM registration, students;

1 个答案:

答案 0 :(得分:1)

SELECT courseNo, section, count(*) as [count]
FROM registration, students 
WHERE registration.idno = students.idno 
group by courseNo,section