Home > Database > Mysql Tutorial > body text

Sql Server中一个表2个字段关联同一个表(代码解决)

WBOY
Release: 2016-06-07 17:55:04
Original
1158 people have browsed it

Sql Server中一个表2个字段关联同一个表(代码解决),需要的朋友可以参考一下

代码如下:
select a.man_id,man_name,d.sex_name,zw_name,c.money
from man as a
left join zw as b on a.zw_id=b.zw_id
left join zw as c on a.man_id=c.man_id -- 同时关联zw字段,通过表别名区别开
left join xb as d on c.sex_id=d.sex_id
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!