Last post Apr 27, 2019 07:11 AM by oned_gk
Apr 26, 2019 05:20 AM|Rameezwaheed|LINK
I want to add the variable values based on counting number in sql server query
Suppose I have variable value = 40 and count number = 3 then result will be
40+ 40+40 = 120
Basically counting number is dynamic
suggest the way
Apr 26, 2019 08:02 AM|Ackerly Xu|LINK
Not sure about your requirement.
Seems you want to get value*number, then declare a variable value and a variable number.
declare @value int;
declare @number int;
set @number =3;
If this is not your case , please show your data in table and your desired result.
Maybe you need case keyword in sqlquery.
Apr 27, 2019 07:11 AM|oned_gk|LINK
SELECT @var * count(*) ...