Select only some columns from a table on a JOIN

Of course. Just list the columns you want to select as you would in any query:

SELECT table1.column1, table1.column2, table2.column3
FROM table1
LEFT JOIN table2 ON (...)

Note that I’ve included the table1. or table2. prefix on all columns to be sure there aren’t any ambiguities where fields with the same name exist in both tables.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)