I just started today with SQL and have following (probably quite newbie) question:
Given two Data Bases Data1 & Data2 having the same number of rows and an identical first column. I want to get all the columns from Data1, but only the rows that meet a condition involving columns of Data2.
I tried something like
SELECT
column2
column3
...
FROM
Data1
INNER JOIN Data2 ON Data1.column1 = Data2.column1
WHERE 'condition1 involving columns in Data2',
'condition2 involving columns in Data2',
...
;
This does not give me the column1, though. If I include it in the select statement above it throws an error 'Column reference column1 is ambiguous'.
Any ideas what is going on?