内连接三表 [英] Inner Joining three tables

查看:23
本文介绍了内连接三表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望通过它们之间的公共列在内部连接三个表.

I have three tables I wish to inner join by a common column between them.

说我的桌子是;

TableA TableB TableC

我希望加入 A-B,但也希望 B-C 都通过这个我称之为 common 的公共领域.

I wish to join A-B, but then also B-C all by this common field I will call common.

我已经加入了两个这样的表;

I have joined two tables like this;

dbo.tableA AS A INNER JOIN dbo.TableB AS B
ON A.common = B.common

如何添加第三个?

推荐答案

select *
from
    tableA a
        inner join
    tableB b
        on a.common = b.common
        inner join 
    TableC c
        on b.common = c.common

这篇关于内连接三表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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