basic many-to-many sql select query

后端 未结 9 1812
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-17 03:06

I think this should be easy, but it\'s evading me. I\'ve got a many-to-many relationship between Accounts and Account Groups. An Account can be in zero or more Groups, so I\

9条回答
  •  不思量自难忘°
    2021-01-17 03:53

    Not only use the query designer as suggested earlier, but also use the MS Access relationship tool to record the relationship between the two foreign keys (AID, GID) and the primary keys they reference.

    This makes doing natural joins in the query designer almost child's play. You can even use a query wizard in the situation you outlined.

    Once you have the query built, why not use the query as a record source instead of using the tables?

    The one thing I would do in PHP would be converting the multiple results into a comma separated list.

提交回复
热议问题