Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这是我数据库中的图像http://oi46.tinypic.com/2eb5lpw.jpg
我想知道是否可以通过restID从“膳食”中获取帖子?
这很容易:
SELECT m.* FROM meals m JOIN cats c ON m.catId=c.catId WHERE restId='theRestIdIWantToQuery'
是的,可以加入所有三个表
select * from restaurant r inner join cats c on r.id=c.restId inner join meals m on c.id = m.catID where r.id=YOURRESTID