MySQL: return updated rows

Apparently mysql does have something that might be of use, especially if you are only updating one row.

This example is from: http://lists.mysql.com/mysql/219882

UPDATE mytable SET
mycolumn = @mycolumn := mycolumn + 1
WHERE mykey = 'dante';

SELECT @mycolumn;

I’ve never tried this though, but do let me know how you get on.

Leave a Comment