Update returned order in postgresql
I have a query updating rows in a table. I want the query to update rows and return the affected rows.
I currently have
UPDATE employees SET name = 'John' RETURNING employees.*;
This works great. But what if I want to return the rows touched in the order shown. Something like
UPDATE employees SET name = 'John' RETURNING employees.* ORDER BY name ASC;
This does not work. Anyone got a good offer?
+3
source to share