Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.15 KB | None | 0 0
  1. SELECT t.id, t.name, COUNT(*) as cnt
  2.   FROM teacher_student as ts
  3.   JOIN teacher as t ON ts.teacher_id = t.id
  4.  GROUP BY ts.teacher_id
  5. HAVING cnt >=5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement