當前位置:首頁 » 法規百科 » sql語法規范join

sql語法規范join

發布時間: 2024-04-16 08:19:54

❶ 奼係QL璇鍙ラ噷闈join鐨勭敤娉,奼備緥瀛愬強璁茶В銆

join 鐢ㄤ簬鏍規嵁涓や釜鎴栧氫釜琛ㄤ腑鐨勫垪涔嬮棿鐨勫叧緋伙紝浠庤繖浜涜〃涓鏌ヨ㈡暟鎹銆

JOIN: 濡傛灉琛ㄤ腑鏈夎嚦灝戜竴涓鍖歸厤錛屽垯榪斿洖琛
LEFT JOIN: 鍗充嬌鍙寵〃涓娌℃湁鍖歸厤錛屼篃浠庡乏琛ㄨ繑鍥炴墍鏈夌殑琛
RIGHT JOIN: 鍗充嬌宸﹁〃涓娌℃湁鍖歸厤錛屼篃浠庡彸琛ㄨ繑鍥炴墍鏈夌殑琛
FULL JOIN: 鍙瑕佸叾涓涓涓琛ㄤ腑瀛樺湪鍖歸厤錛屽氨榪斿洖琛

SQL INNER JOIN 鍏抽敭瀛
鍦ㄨ〃涓瀛樺湪鑷沖皯涓涓鍖歸厤鏃訛紝INNER JOIN 鍏抽敭瀛楄繑鍥炶屻
INNER JOIN 鍏抽敭瀛楄娉
SELECT column_name(s)
FROM table_name1
INNER JOIN table_name2
ON table_name1.column_name=table_name2.column_name
娉ㄩ噴錛欼NNER JOIN 涓 JOIN 鏄鐩稿悓鐨勩

SQL LEFT JOIN 鍏抽敭瀛
LEFT JOIN 鍏抽敭瀛椾細浠庡乏琛 (table_name1) 閭i噷榪斿洖鎵鏈夌殑琛岋紝鍗充嬌鍦ㄥ彸琛 (table_name2) 涓娌℃湁鍖歸厤鐨勮屻

LEFT JOIN 鍏抽敭瀛楄娉
SELECT column_name(s)
FROM table_name1
LEFT JOIN table_name2
ON table_name1.column_name=table_name2.column_name

SQL RIGHT JOIN 鍏抽敭瀛
RIGHT JOIN 鍏抽敭瀛椾細鍙寵〃 (table_name2) 閭i噷榪斿洖鎵鏈夌殑琛岋紝鍗充嬌鍦ㄥ乏琛 (table_name1) 涓娌℃湁鍖歸厤鐨勮屻

RIGHT JOIN 鍏抽敭瀛楄娉
SELECT column_name(s)
FROM table_name1
RIGHT JOIN table_name2
ON table_name1.column_name=table_name2.column_name
娉ㄩ噴錛氬湪鏌愪簺鏁版嵁搴撲腑錛 RIGHT JOIN 縐頒負 RIGHT OUTER JOIN銆

SQL FULL JOIN 鍏抽敭瀛
鍙瑕佸叾涓鏌愪釜琛ㄥ瓨鍦ㄥ尮閰嶏紝FULL JOIN 鍏抽敭瀛楀氨浼氳繑鍥炶屻

FULL JOIN 鍏抽敭瀛楄娉
SELECT column_name(s)
FROM table_name1
FULL JOIN table_name2
ON table_name1.column_name=table_name2.column_name
娉ㄩ噴錛氬湪鏌愪簺鏁版嵁搴撲腑錛 FULL JOIN 縐頒負 FULL OUTER JOIN銆

http://www.w3school.com.cn/sql/sql_join.asp

熱點內容
建華法院高峰 發布:2025-01-02 01:55:18 瀏覽:629
法律服務所聘用證明 發布:2025-01-02 01:50:20 瀏覽:341
法律碩士歷年 發布:2025-01-02 01:43:33 瀏覽:992
注冊資金1萬法律責任 發布:2025-01-02 01:42:19 瀏覽:209
包裝崗位規章制度 發布:2025-01-02 01:42:12 瀏覽:523
金安區司法局 發布:2025-01-02 01:40:39 瀏覽:864
電子司法證據 發布:2025-01-02 00:56:30 瀏覽:548
北京尹律師 發布:2025-01-02 00:42:21 瀏覽:932
蕪湖法院號碼 發布:2025-01-02 00:20:22 瀏覽:375
法官會工作 發布:2025-01-02 00:15:23 瀏覽:185