[英]How I can retrieve data from a table
I have these two tables in my database.我的数据库中有这两个表。
table1:表1:
table2:表2:
How I can write sql query retrieve all the data from table1 by id=201102887 which is written in table2我如何编写 sql 查询,通过 id=201102887 从 table1 中检索所有数据,该数据写入 table2
A simple JOIN
will do.一个简单的
JOIN
就可以了。
select table1.*
from table1 inner join table2 ON table1.title = table2.major
where table2.id = 201102887
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.