I have three tables: keywords, queries, and keywords_queries. keywords_queries has two columns; one linking to a keywords id and the other linking to a queries id. If I have the id of the query and a list of keywords that I want to link it to, what is the most efficient way to look up the id’s of the keywords I have and insert them into the keywords_queries table? Obviously I could do a big SELECT query and use the results to build an INSERT query but is there some way to do it in one query? Also the keywords I’m looking up are guaranteed to be in the keywords table.
I have three tables: keywords , queries , and keywords_queries . keywords_queries has two
Share
1 Answer