Mysql
 sql >> Database >  >> RDS >> Mysql

Mysql Query Relations Tabella M-M

Se conosci l'ID del gruppo

select member.* from member m
  inner join member_has_group mg on m.id = mg.id_member
where mg.id_group = [x]

Se conosci solo il nome del gruppo

select member.* from member m
  inner join member_has_group mg on m.id = mg.id_member
  inner join group g on g.id = mg.id_group
where g.name = 'group name'