老师表的结果如何获得MySQL查询与条件
teacher_id teacher_name
============================
1 john
2 doe
学生表
student_id student_name student_score teacher_id
==========================================================
1 amelia 0 1
2 anderson 0 1
3 fabiano 0 1
4 ronaldo 0 2
5 peter 6 2
6 alex 0 2
结果
teacher_id teacher_name
============================
2 doe
结果是老师记录谁一个或更多的是他的学生得分> 0。
如何查询这个?
感谢您的回答和对不起我的英文不好
SQL Basic应该可以帮到你。 – Milaci
[Left join with condition]的可能重复(http://stackoverflow.com/questions/9160991/left-join-with-condition) – PereG
选择t。 teacher_id,T。 teacher_name from teacher t,student's where t.teacher_id = s.teacher_id and s.score> 0. – Milaci