I'm trying to join two tables together as shown below, in the " * " section, I'm having trouble doing the following,
Operation: want to select all columns on the left, and just wanna attach few relevant columns from the right table to the left table. Instead of writing all the columns like left_table.column1, left_table.column2 ... so on is there another method which saves the manual coding?
SELECT * FROM nutrients LEFT JOIN measures ON nutrients.name=measures.name
Yes, add the table name before the *
to select all columns of a table
SELECT nutrients.*, measures.colX
FROM nutrients
LEFT JOIN measures ON nutrients.name=measures.name
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With