I was asked to write a query that has 14 variables.
the query should look like this:
declare x1 int;
declare x2 int;
declare x3 int;
declare x4 int;
declare x5 int;
declare x6 int;
declare x7 int;
case when fieldname=value1 then val1*x1 end
case when fieldname=value2 then val2*x2 end
case when fieldname=value3 then val3*x3 end
case when fieldname=value4 then val4*x4 end
case when fieldname=value5 then val5*x5 end
case when fieldname=value6 then val6*x6 end
case when fieldname=value7 then val7*x7 end
The user would like it that way because he wants to be able to change the values only in one place.
because of the nature of the query I have to use the case command.