求问超级简单的数据表查询如何写

WBOY
Release: 2016-06-13 12:08:30
Original
1030 people have browsed it

求问超级简单的数据表查询怎么写?
表A字段:id  title  text

表B 字段:id Aid  

表A的id 存为表B的Aid。

查询出表B的 Aid,然后再通过Aid查询出表A的title  ,直接写出一句SQL,怎么写?
------解决思路----------------------

selcet * from A where id IN (select Aid from b);
Copy after login

不知道是不是你想要的。
------解决思路----------------------
select B.Aid,A.title from B join A on B.Aid=A.id
------解决思路----------------------
select A.title from A,B where A.id=B.Aid 

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