My acceptance ratio
Q&A for anime and manga fans
-- Tireless and Unsung Hero -- My acceptance ratio so far. declare @user int = ##UserID## declare @temp table(total int, zero int); insert into @temp(total, zero) values((select count(p1.id) from posts p1, posts p2 where p1.owneruserid = @user and p1.id = p2.acceptedanswerid group by p1.owneruserid), (select count(p1.id) from posts p1, posts p2 where p1.owneruserid = @user and p1.score = 0 and p1.id = p2.acceptedanswerid group by p1.owneruserid)); select zero as 'Zero Scored', total as 'Total Accepted', zero * 100 / total as 'Ratio' from @temp;