Select only some columns from a table on a LEFT JOIN

前端 未结 3 415
野性不改
野性不改 2021-02-05 06:20

Is it possible to select only some columns from a table on a LEFT JOIN?

3条回答
  •  攒了一身酷
    2021-02-05 07:10

    Add a * to just that table in your select statement, separate from other columns with a comma:

    SELECT table1.*, table2.col2, table2.col3
    FROM table1
    LEFT JOIN table2
    ON...
    

    Source: https://stackoverflow.com/a/3492919/3417198

提交回复
热议问题