MySql-PhpMyAdmin(圖形化介面)-4.使用JOIN方式查詢

文:意如

主表:contact 
副表:def_contact_likeweb
連結:
SELECT contact.pk, contact.username,contact.phone, contact.like_web,def_contact_likeweb.note 
FROM contact 
INNER JOIN def_contact_likeweb ON contact.like_web=def_contact_likeweb.item
多加一個副表:def_contact_state

 

SELECT contact.pk, contact.username,contact.phone, 
def_contact_likeweb.note as likeweb , 
def_contact_state.note as contactstate 
FROM contact
INNER JOIN def_contact_likeweb ON contact.like_web=def_contact_likeweb.item 
INNER JOIN def_contact_state ON contact.state=def_contact_state.item 
WHERE contact.del=0

關聯圖:

https://drive.google.com/file/d/1hsBiq34ExG-IwZSBII_9PlC2gICi_t4C/view?usp=sharing

Yiru@Studio - 關於我 - 意如