select r.studentno,r.studentname,r.total from (
select t.studentno,t.studentname,count(1) total from tb_studented t,tb_course c,student_course s
where t.id = s.student_id and c.id = s.course_id group by t.studentno,t.studentname
) r where r.total = (select max(total) from (select s.student_id,count(1) total from student_course s group by s.student_id))
StringBuilder sql =new StringBuilder();
hibernate 在工程中我建了Student.java 和Course.java 配置好映射,中间的连接表叫student_course , 这个是写的查找选课最多的学生的信息,求大神写成HQL 语句