Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

How to perform the Delete dml in postgres and get the number of deleted rows at the same time?

user-image
Question added by Deleted user
Date Posted: 2015/08/05

using RETURNING clause 

WITH deleted AS (DELETE FROM table WHERE condition IS TRUE RETURNING *) SELECT count(*) FROM deleted;

 

More Questions Like This

Do you need help in adding the right keywords to your CV? Let our CV writing experts help you.