Home  >  Article  >  Backend Development  >  不建立外键,不用表连接,怎么查询两个关联表的数据

不建立外键,不用表连接,怎么查询两个关联表的数据

WBOY
WBOYOriginal
2016-06-13 12:19:511602browse

不建立外键,不用表连接,如何查询两个关联表的数据
查询两个有关联的数据表,一个表是cate分类表,另一个是game游戏表,分类表的id=game表的cate_id ,不用表连接,不建立外键,怎么将game表的数据和cate表的数据一一对应查出来。
求答
------解决思路----------------------
遍历 cate
  按 cate.id=game.cate_idgame 的条件查询 game

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn