MySql-語法練習5-合併 INNER

文、意如

先建立兩個資料表(客戶資料表、訂單資料表)

客戶資料  
cus_pkcus_namecus_phone
1john0912345678
2may0912345674
3judy0912345234
   
   
訂單  
order_pkcus_pkorder_date
122022-12-21
232022-12-21
312022-12-21

 

合併

SELECT myorder.order_pk, customers.cus_name, myorder.orderdate FROM myorder INNER JOIN customers ON myorder.cus_pk=customers.cus_pk;


 

 

 

Yiru@Studio - 關於我 - 意如