关于sql server数据库??在线急等
来源:百度知道 编辑:UC知道 时间:2024/05/30 22:46:09
内连接: select * from table1 inner join table2 on table1.id = table2.id
select * from table1 , table2 where table1.id = table2.id
内联 两个表是绝对的条件连接, 会过滤其他不符合连接条件数据
外链接:select * from table1 left join table2 on table1.id = table2.id
等效(select * from table1 inner join table2 on table1.id *= table2.id)
外联1 一个表条件关联另一个表的数据, 如上table1表不符合连接条件的数据不会过滤掉,只是table2表无对应数据,相应列补NULL
select * from table1 right join table2 on table1.id = table2.id
等效(select * from table1 inner join table2 on table2.id *= table1.id)
外联2 如外联1 只是table1 table2 表角色变化了,自己理解一下
内连接: select * from table1 inner join table2 on table1.id = table2.id
select * from table1 , table2 where table1.id = table2.id
外链接:select * from table1 left join table2 on table1.id = table2.id
select * from table1 right join table2 on table1.id = table2.id