79517541

Date: 2025-03-18 13:15:34
Score: 0.5
Natty:
Report link

You can simply use the SET command:

DECLARE deletedRowCount integer;
WITH deleted as 
(
    DELETE FROM MyTable "t"
    USING tmp_closed_positions
    WHERE condition
    RETURNING "t"."Id"
)
set deletedRowCount = (SELECT COUNT(*) FROM deleted);
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Jerome2606