Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: variable into update
12-19-2012, 12:02 PM #1
- Join Date
- Dec 2005
- Thanked 76 Times in 76 Posts
variable into updateCode:
update t set f = UUID() where id = 5
I want same UUID for each record !
I know how to do it in two separate sql-s, but I'm almost sure that could be done with one sql only (creating & using varaible inside sql).
How to do it, if possible ?
12-19-2012, 07:52 PM #2
Well, I don't know how to do it in one query, but I know how to do it all in a single operation.
SET @u = UUID(); UPDATE t SET f = @u WHERE id = 5;
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.