hola,
i must update 3 columns (yesterday, today, tomorrow) of table XXX.
the correct value of 'today' in on another table YYY.
This is my actual:
update XXX
set today = (select today from yyy)
, yesterday = (select today from yyy) - 1 day
, tomorrow = (select today from yyy) + 1 day
;
Can I set a variable for the value of today?
I don't want do 3 select on yyy but only 1!
I have to say I am not sure if this would work but can you try this:
update XXX
set (today, yesterday, tomorrow) = (select today, today - 1 day, today + 1 day from yyy)
;
Right now I don't have any means to test this but if you test (and it works) then please let me know ;-)