3

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?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Yossale
  • 14,165
  • 22
  • 82
  • 109

1 Answers1

6
SELECT @totalRep = SUM(Users.Reputation) FROM Users
LittleBobbyTables - Au Revoir
  • 32,008
  • 25
  • 109
  • 114