I am trying to write a How much did I type? query on Stack* Data Explorer.
Modifying an existing query got me this far:
-- How much did I type?
DECLARE @UserId int = ##UserId##
select sum(len(Body)) AS 'Posts' from posts where owneruserid = @UserId,
select sum(len(Text)) AS 'Comments' from comments where userid = @UserId,
(select sum(len(Body)) from posts where owneruserid = @UserId +
select sum(len(Text)) from comments where userid = @UserId) AS 'Total'
I am expecting three columns and one row, something like this:
Posts Comments Total
1234 5678 6912
But there is some syntax problem, due to which I get:
Error: Incorrect syntax near ','. Incorrect syntax near ','. Incorrect syntax near the keyword 'select'. Incorrect syntax near ')'.
What is the correct syntax for this?