Hi there, Im new to SQL and am finding it difficult to find the answers I need from books and searches so here goes:
I have table1, which has two columns: authorID and authorName. authorID is a unique identifier and primary key, authorName is a unique index. At present this table is empty.
I have table2, which amongst many other things, contains an authorName column. There are many records with many duplicated author names (it is a table of books).
My task:
Insert new authorNames from table2 into table1 when the authorName does not already exist in table1. Thus populating table1 with a list of unique authorNames.
Could anyone show me the query I need? I imagine it is reasonably simple, but finding the answer is proving a pain!
Thanks in advance
DT
I have table1, which has two columns: authorID and authorName. authorID is a unique identifier and primary key, authorName is a unique index. At present this table is empty.
I have table2, which amongst many other things, contains an authorName column. There are many records with many duplicated author names (it is a table of books).
My task:
Insert new authorNames from table2 into table1 when the authorName does not already exist in table1. Thus populating table1 with a list of unique authorNames.
Could anyone show me the query I need? I imagine it is reasonably simple, but finding the answer is proving a pain!
Thanks in advance
DT