Sum the array times n, except the last

0

Please login or register to vote for this query.

(click on this box to dismiss)

Craft CMS Meta

Q&A about the site for administrators, end users, developers and designers for Craft CMS

DECLARE @ INT=10
CREATE table #t(a int,i int identity)
INSERT #t values(1)

SELECT sum(a*@-~-@*i*m)FROM(SELECT
i/max(i)over()m,*FROM #t)x

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results