سؤال

I'm trying to run this query on the SO Data Explorer:

DECLARE @totalRep float

SET @totalRep = SELECT SUM(Users.Reputation) FROM Users

And I keep getting

Incorrect syntax near the keyword 'SELECT'.

What am I doing wrong?

هل كانت مفيدة؟

المحلول

SELECT @totalRep = SUM(Users.Reputation) FROM Users
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top