Home > Backend Development > PHP Tutorial > 请问个基础的mysql查询有关问题

请问个基础的mysql查询有关问题

WBOY
Release: 2016-06-13 12:53:57
Original
855 people have browsed it

请教个基础的mysql查询问题
两个表,一个是图片表,一个是关注表

需求是这样的:查出所有a用户发布和a用户关注的图片

a发布的好找,直接在图片表里查uid=a就OK.  求解如何一条语句把需要的这种情况查出来....

谢谢

mysql
------解决方案--------------------
研究下union和join语法吧
------解决方案--------------------
说清楚点哈  比如 有没有关联字段什么的 还是两张表就是独立的啊
------解决方案--------------------
贴出表的结构~~
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template