I am trying to store the data I have deleted in a variable but it isn't quite working yet. One of my last attempts was this:
newData:= (DELETE FROM ATableName WHERE AColumnName=100 RETURNING *);
I am trying to store the data I have deleted in a variable but it isn't quite working yet. One of my last attempts was this:
newData:= (DELETE FROM ATableName WHERE AColumnName=100 RETURNING *);
Sorry to say, I don't think this has been implemented yet (MDEV-8347).
A way to use a temporary table:
CREATE TEMPORARY TABLE A100 LIKE ATableName;
INSERT INTO A100 SELECT * FROM ATableName WHERE AColumnName=100;
DELETE FROM ATableName INNER JOIN A100 USING (Apk);
This leaves A100 with the contents deleted.