Joining 2 tables in SELECT(MYSQL/PHP)

后端 未结 6 1895
离开以前
离开以前 2020-12-21 22:20

I have these two tables. The connecting \"key\" is conID which is included in both tables. So now i would like to write select statement which would give me something like

6条回答
  •  無奈伤痛
    2020-12-21 23:05

    You SQL query should look like this:

    SELECT p.Name, p.lastName, p.address, p.conID, c.postNum, c.region
    FROM people p 
    LEFT JOIN countries c ON p.conID = c.conID
    

提交回复
热议问题