我尝试使用ansi连接将两个表连接到一个表。我可以在哪里
这样做加入地点:
select
name.name,
middle.name,
last.name
from
name,
middle,
last
where
name.middleid = middle.id
and name.lastid = last.id
and name.name = 'BOB'
我能够弄清楚如何将中间名称加入名称表,但是一旦我在最后一张表中添加,我就不成功
ANSI JOIN:
select
name.name,
middle.name,
last.name
from
name join middle on name.middleid = middle.id
**-- How do i join the name table to the last table?**
where
name.name = 'BOB'
答案 0 :(得分:0)
试
ANSI JOIN:
select
name.name,
middle.name,
last.name
from
name join middle on name.middleid = middle.id
join last on name.lastid = last.id
**-- How do i join the name table to the last table?**
where
name.name = 'BOB'
答案 1 :(得分:0)
它在你的问题中
select
name.name,
middle.name,
last.name
from
name join middle on name.middleid = middle.id
join last on name.lastid = last.id
where
name.name = 'BOB'
答案 2 :(得分:0)
一旦你加入了两个表,就把它们想象成一个不方便用不同的表(也就是命名空间)为列名加前缀的
所以你再次加入两张桌子。
答案 3 :(得分:0)
ANSI JOIN:
select
name.name,
middle.name,
last.name
from
name
join middle on name.middleid = middle.id
join last on name.lastid = last.id
where
name.name = 'BOB'