加入3个表在sqlserver中非常复杂 [英] join 3 tables very complicated in sqlserver

查看:72
本文介绍了加入3个表在sqlserver中非常复杂的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有3个表(员工,结构,区)
1_employee empid,workid fk到structid,actuallwork fk到struct id 2_结构structid,districtId fk到District 3_District districtid,districtname

我想得到

熟练,工作,实际工作

我想在工作和实际工作区名称下使用

i have 3 tables (employee,structure,District)
1_employee empid,workid fk to structid ,actuallwork fk to struct id 2_ structure structid , districtId fk to district 3_District districtid , districtname

i want to get

empid , work , actuallwork

i want under work and actualwork district name

推荐答案

SELECT table.column, table1.column, table2.column, ...
FROM table
JOIN table1 on table1.column = table.column
JOIN table2 on table1.column = table1.column



有什么这么复杂的?



What is so complicated?


这篇关于加入3个表在sqlserver中非常复杂的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆