This question is the continuation of this one.
I have the following table egr:
egr
+---------+------------+ | offid | groupid | +---------+
This may be easier to achieve using the except operator:
except
INSERT INTO egr (offid, groupid) SELECT 2, groupid FROM egr WHERE offid = 1 EXCEPT SELECT 2, groupid FROM egr WHERE offid = 2