Question about inner join

Category: MS-SQL Server -> Foundation Classes Author: zl410594255 Date: 2001-08-16 18:39:06
 
zl410594255
2001-08-16 18:39:06
input:

tb1: col1 int
col2 int
col3 int
.... coln int

tb2: seid int
sename varchar (100)

where col1, col2, col3 reference tb2 these three are the seid, then the Inner join on how to write it?

output:

write col1, col2, col3 corresponding sename to play out
rachaelzoey
2001-08-16 18:59:02

select b.name as bnamd,c.name as cname,d.name as dname
from tb a left join tb1 b on a.col1 = b.id
          left join tb1 c on a.col2 = b.id
          left join tb1 d on a.col3 = d.id
yy21137205
2001-08-16 19:13:49

agree to use an alias
yedipo
2001-08-16 19:24:19
Why not INNER JOIN?
bbmjob
2001-08-16 19:39:59
I do not think there is no match output, may use INNER JOIN, which should see to their needs, is it I want to focus on

with others , so it looks as if it will tb2 connection every time when they are seen as a new table, right, so it will not affect each other, so to understand it
gaodahou
2001-08-16 19:55:33


left join is right, join it will be missing part of the data, inner join two tables that match the criteria, if the main table does not exist then the whole of the seid data is not displayed, left join is left connections to the left of the table as a benchmark, query qualified data, no is null
chenyun200867
2001-08-16 20:08:32


as a new table, so that you can understand! Because the table is fixed there, how many times cited data is unchanged.
oubie
2001-08-16 20:25:17
decisively knot stickers, small three real cow