example contrived for this example. I have a product table and I need to update the amount column table ( float4 datatype) based on the increment percentage column.
CREATE TABLE public."Product" (
id int4 NOT NULL DEFAULT, "incrementPercentage" float4 NULL, "amount" float4 NULL, ... );
the incrementPercentage column might have a value or it might be null , so i want to know if the update statement with a case statement will work best. also, would like after I would like to limit the value to 2 decimal places.
UPDATE Product SET amount = CASE WHEN incrementPercentage IS NOT NULL THEN ((incrementPercentage /100)*incrementPercentage + amount ) ELSE amount END