Mysql
 sql >> Datenbank >  >> RDS >> Mysql

MySQL-Abfragebeziehungen M-M-Tabelle

Wenn Sie die Gruppen-ID kennen

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

Wenn Sie nur den Gruppennamen kennen

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'