I have a column, num, and I’m trying to update the column such that num = num / MAX(num). Now the thing is that MAX(num) should remain static throughout the update.. it should be the MAX prior to the update. I was wondering whether this was possible to do in one SQL statement. The obvious solution otherwise that I’m currently using it
val = select max(num) from table;
update table set num = num / val
I’m not certain of the syntax, or what the performance implications would be, but how about something like this?