Reputation: 13
I'm trying to make a select, joining the columns of the table1 and the values from table2.
I'm not really sure about the statement I need to do it, but, look, I'm looking for something like this:
Upvotes: 0
Views: 52
Reputation: 311338
If you want to get all these columns on each row, you should be using a join
, not union
. E.g.:
SELECT colum1, column2, column3, column4, column5
FROM table1
JOIN table2 ON table1.id = table2.id
Upvotes: 1