DECLARE @UserId int; set @UserID = 4; select (select sum...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Chess Meta

Q&A about the site for serious players and enthusiasts of chess

DECLARE @UserId int;
set @UserID = 4;  

select (select sum(len(Body)) from posts where owneruserid = @UserId) AS 'Posts',
       (select sum(len(Text)) from comments where userid = @UserId) AS 'Comments',
'Posts' + 'Comments' AS 'Total'

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results