What type of JOIN to use

前端 未结 2 1468
后悔当初
后悔当初 2020-12-12 08:17

What type of JOIN would I use to get table1 and table2 to be matched only once. For example, I have table1 (40 rows) and table2<

2条回答
  •  無奈伤痛
    2020-12-12 08:35

    SELECT * FROM table1 LEFT JOIN table2 ON `table_1_primary_key` = `table_2_primary_key`
    

    Or SELECT colname FROM table1 LEFT JOIN table2 ON table_1.colname = table_2.colname

    Depending on the structure of your database

提交回复
热议问题