I have a column, num, and I am trying to update the column, such as num = Num / MAX (number) . Now the thing is that the maximum must be constant during the update. It should be maximum before updating. I was wondering if it was possible to do this in a SQL statement. The obvious solution otherwise that I am currently using it
val = select the maximum (num) from the table;
Update table set num = Num / val
I'm not sure of the syntax, or what the effect of the display would be, but how about something like that?
Include in the update table (with value as the selection number) SET num = num / val;
Comments
Post a Comment