SQLite Forum

DELETE FROM … RETURNING
Login
If we could use a DELETE statement as a CTE¹, you could sort it thus:

```
WITH deleted AS (DELETE FROM foo WHERE condition RETURNING stuff)
SELECT * FROM deleted ORDER BY something;
```

¹ This capability is on my wishlist, but I am not holding my breath waiting for it. ;-)