I have Table 1 and Table 2. These two tables have a column with data that matches, Table_1.Column A and Table_2.Column Z.
I want to match the values from Column Z to all the data in Column A. But I also want to attach the corresponding data which is in Table 2, Column Y.
Table 1 Column A Table 2 Column Z Table 2 Column Y 1 4 10 2 3 11 3 2 12 4 1 13 How to I match Column A and Column Z, also including Column Y?
I would want a result like this:
Table 1 Column A Table 2 Column Z Table 2 Column Y 1 1 13 2 2 12 3 3 11 4 4 10
I believe I need to do something along these lines:
SELECT Table_1.Column_A, Table_2.Column_Z, Table_2.Column_Y
FROM Table_1, Table_2
GROUP BY Table_1.Column_A
WHERE Table_1.Column_A = Table_2.Column_Z
** The suggested previous post did not answer my question. I am not very proficient in SQL. Do I need to do a JOIN? I keep getting errors with my query.
SELECT Table_1.Column_A, Table_2.Column_Z, Table_2.Column_Y
FROM Table_1
LEFT JOIN Table_1.Column_A ON Table_1.Column_A = Table_2.Column_Z;
Thanks in advance for any help.