I know there’s probably a simple way to do this, but I can’t seem to remember how.
Basically, I have a table with 2 fields, ID1 and ID2. I want to find all fields with an id2 = 1, and insert another record into the table with that id1 and a different id2.
So the query to select all the fields that I want a new record for is:
select id1 from mytable where id2 = 1
And then for each of those I want to insert:
insert into mytable(id1, id2) values([this id1], 6)
You basically just have to combine the two queries you’ve already written in a slightly different way: