mysql

WBOY
Release: 2016-06-23 14:10:34
Original
849 people have browsed it

我有一个用户表,里面有号码之类的信息,我还有一个表,
放的是地址之类的信息,里面没有号码,两个表里都有邮箱,查询第二里所有的信息加第一个表的号码。
就是简单的查询,可我实在想不到了


回复讨论(解决方案)

select T1.number,T2.* from table1 T1,table2 T2 where T1.id = $id AND T2.id = $id 
大概是这样

select a.* ,b.号码 from 还有一个表 a left join 用户表  b on a.邮箱=b.邮箱;

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