这个问题在这里已经有答案了:
mysql仅从最新日期选择不同的记录(2个答案)
两年前关门了。
表行
no | f_member_id | f_teacher_id | f_class_date
1 | jenny | teacher_a | 2017-12-03
3 | jenny | teacher_a | 2017-12-05
2 | jenny | teacher_a | 2017-12-04
4 | tom | teacher_a | 2017-11-27
5 | tom | teacher_a | 2017-11-28
“a老师”需要看到这样的结果。
---------------
jenny | teacher_a | 2017-12-05
tom | teacher_a | 2017-11-28
------
***老师所在班级的学生姓名的最近上课日期。
我这样问。不起作用。
SELECT distinct(f_member_id), f_class_date
FROM `classroom` where f_teacher_id='teacher'
group by f_member_id
order by f_class_date desc
1条答案
按热度按时间vngu2lb81#