Make homepage|Add to favorites
 

MYSQL TOOLS
reviews, articles, tips & snippets

 
Buy SQL » MySQL » Get updated value from UPDATE statement without querying the table again

Get updated value from UPDATE statement without querying the table again

Author: rootsql Date: 1-11-2011, 22:04

Shows how to get the value from updated row in one query (without additional SELECT query).

UPDATE table1 SET column1 = @var1:= column1 + 5 WHERE id = 1 LIMIT 1;
SELECT @var1;

Tags: Tips

Dear visitor, you went to the site as unregistered user.
We recommend you to Register or Sign In.

Comments:

Leave a comment
Information
Members of Guests cannot leave comments.