左连接where只影向右表,右连接where只影响左表。
左连接:左边有的,右边没有的为null
select from table1 left join tbale2 on table1.id=table2.id
这条sql语句返回结果 table1表中的数据全部返回 table2表中的数据只返回满足where条件的
右连接:左边没有的,右边有的为null
select from table1 right join table2 on table1.id=table2.id
这条sql语句返回结果 table2表中的数据全部返回 table1表中的数据只返回满足where条件的
内连接:显示左边右边共有的
select * from table1 inner join table2 on table1.id = table2.id
这条sql语句返回结果 显示满足条件的数据 并不以谁为主表
點(diǎn)擊查看更多內(nèi)容
為 TA 點(diǎn)贊
評論
評論
共同學(xué)習(xí),寫下你的評論
評論加載中...
作者其他優(yōu)質(zhì)文章
正在加載中
感謝您的支持,我會(huì)繼續(xù)努力的~
掃碼打賞,你說多少就多少
贊賞金額會(huì)直接到老師賬戶
支付方式
打開微信掃一掃,即可進(jìn)行掃碼打賞哦