Isso pode ser mais fácil de conseguir usando o
except
operador:INSERT INTO egr (offid, groupid)
SELECT 2, groupid
FROM egr
WHERE offid = 1
EXCEPT
SELECT 2, groupid
FROM egr
WHERE offid = 2
except
operador:INSERT INTO egr (offid, groupid)
SELECT 2, groupid
FROM egr
WHERE offid = 1
EXCEPT
SELECT 2, groupid
FROM egr
WHERE offid = 2