2019-01-17
閱讀量:
841
MySQL連接查詢
內(nèi)連接:select * from A inner join B on A.Key = B.Key;
左連接:select * from A left join B on A.Key = B.Key;
右連接:select * from A right join B on A.Key = B.Key;
等值連接:select A_name,B_name,B_mobile from A, B where A.A_id = B.B_id
自連接:select p1.user_id, p1.user_name from usertable as p1, usertable as p2 where p1.user_id = p2.user_id and p2.user_id = '10086';
交叉連接:卡迪爾積,沒有建立聯(lián)結(jié)關(guān)系的表,行數(shù)為兩表行數(shù)相乘
等值連接和內(nèi)連接查詢效果等效,用on建立連接關(guān)系,用where進(jìn)行篩選
mysql 不支持 full join






評論(0)


暫無數(shù)據(jù)
推薦帖子
0條評論
0條評論
0條評論
0條評論