longest post for a user


Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

DECLARE @displayname varchar(100) = '##displayname##'
--select len(@displayname),@displayname
--select * from users where displayname=@displayname
select top 10 a.id as [Post Link],len(a.body) as Length from posts a,posts q where a.parentid = q.id and a.owneruserid in (select id from users where displayname=@displayname) order by len(a.body) desc

Enter Parameters

Switch to meta site
loading Hold tight while we fetch your results