Never Wrong

0

Please login or register to vote for this query.

(click on this box to dismiss)

Motor Vehicle Maintenance and Repair Meta

Q&A about the site for mechanics and DIY enthusiast owners of cars, trucks, and motorcycles

DECLARE @ed INT;
SELECT 
    @ed = u.Id
FROM dbo.Users AS u
WHERE u.DisplayName = 'Paul White'
AND   u.Reputation > 30000;


SELECT 
    COUNT_BIG(*) AS total,
    SUM(CASE WHEN p.LastEditDate IS NOT NULL THEN 1 ELSE 0 END) AS edited,
    SUM(CASE WHEN p.LastEditDate IS NULL THEN 1 ELSE 0 END) AS not_edited
FROM dbo.Posts AS p
WHERE p.OwnerUserId = @ed
OPTION(RECOMPILE);

Enter Parameters

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