Before, you’d have to either load the data in the client side or duplicate the CTE across two statements in a transaction.
WITH results as ( SELECT ... ), inserted_rows AS ( INSERT ... SELECT * FROM results ... ), deleted_rows AS ( DELETE ... USING results ... ) UPDATE ... FROM results
It seems you’re knowledgeable on this, do you know if MERGE useful beyond expressivity?
Before, you’d have to either load the data in the client side or duplicate the CTE across two statements in a transaction.