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(3),(1),(4),(1),(5)

SELECT sum(a*@-i/@@rowcount*~-@*a)FROM #t

Enter Parameters

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