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