I have a list like this thing1,thing2,thing3. And I want to insert them into a look-up table with the same foreign key. So ideally it would look like this:
This answer is similar to Matt's but does not use conditional logic.
insert into lkp_things (foreign_key, thing) select 0, '' where 1=2 union select ,
Both our answers assume that the id variable does not change and was set somewhere else.