2021.3.26美团-大数据开发-实习-一面
select student.id,student.name,book.stu_id ,count(*) as total from student, book wherestudent.id=book.stu_id and student.age=18 and student.gender=‘男’group by book.nameorder by total desc limit 1;面试时没看到book中id是否为主键的问题,如果为主键那么久不能有重复值,假设book的name是没有重复的,.
原创
2021-03-26 20:10:46 ·
588 阅读 ·
0 评论