I have 3 tables:
TABLE 1 userID | userName
TABLE 2 topicID | topicName
TABLE 3 userID | topicID (One user can have several topics asigned)
I am receiving a string of topicNames and a userID. I need to insert this data into table 3 but first I need to get the topicIds from table 2. Currently my solution would be to do a select query to get the topicIds for the topicNames (from table 2) and then use that to insert to Table 3.
Is there a way to do the insertion and the mapping in one query?