inner join和cross join的使用

inner join和cross join的使用和逗号是同样的效果,其中的区别就是,inner join产生的是交叉链接,而cross join是产生内链接而已。ci

例:it

select countryname,statename from country,state 等价于select countryname,statename from country cross join state; select

select countryname,statename from country,state where state.cid = country.id 等价于 elect countryname,statename from country inner join state where state.cid = country.id;co

 

并且,这两个关键字和逗号均可以尽量多的链接不少的表:join

select * from country cross join state cross join city;oss

相关文章
相关标签/搜索