many to many relationship join query in mysql many-to-many code example
Example: sqlalchemy query join many to many
session.query(User).join((Group, User.groups)) \
.join((Department, Group.departments)).filter(Department.name == 'R&D')
session.query(User).join((Group, User.groups)) \
.join((Department, Group.departments)).filter(Department.name == 'R&D')