I have 2 tables which I want to query to populate a 3rd table with.
Table 1 contains about 1M rows of data.
Table 2 contains a lookup/conversion data i.e col 1 contains a code and col 2 contains meaning.
I am querying table 1 but using table 2 to convert where I find the code to the meaning
col 1 col2
code 1 type 1
code 2 type 2
code 3 type 3
So I query table 1 INSERT INTO table 3 (col1, col2, col3, col4) FROM table 1 col 1 col2 (SELECT converted item FROM table 2)...
My problem is that I am getting mutiple rows from the sub query even though all the rows are unique.
What am I doing wrong?