SELECT c.student_name,COUNT(c.student_name)
FROM MEMBER c INNER JOIN NOMTABLE d ON c.depart_name=d.depart_name
WHERE (c.student_role = 'head actor' AND d.section='best head actor') OR (c.student_role = 'supporting actor' AND d.section='best supporting actor') OR
(c.student_role = 'head actress' AND d.section='best head actress') OR (c.student_role = 'supporting actress' AND d.section='best supporting actress')
GROUP BY c.student_name;
这是我的查询,它会给出学生的姓名和学生姓名出现的次数。我想提取具有最大计数的学生姓名,然后我想将该student_name与Table Student中的student_name进行比较,并提取该计数最多的该学生的student_name和date_of_birth。提取最大计数,然后比较
我知道我可以做的选择*从(上面的查询)其中rownum < = 1但之后,我无法比较student_name和学生表中的student_name。
任何帮助,这将是他非常有帮助。非常感谢你。
返回一个错误,ORA-00935:组函数嵌套太深 – user3690321 2014-10-18 21:18:48
更新代码现在试试 – Ram 2014-10-18 21:22:51
ORDER BY COUNT(c.student_name)DESC * 错误在第17行: ORA-00907:缺少右括号 对不起,但现在它说,还有一个错误。尽管感谢帮助我。 – user3690321 2014-10-18 21:53:24