jhanlon homework W6Q1


Please login or register to vote for this query.

(click on this box to dismiss)

Amateur Radio

Q&A for amateur radio enthusiasts

DECLARE @Start datetime ='2013-01-01';
DECLARE @End datetime ='2013-01-08';

  SUM(CASE WHEN (a.Score > 0 AND q.AcceptedAnswerId>0) THEN 1 ELSE 0 END) Accepted, 
                                  --^^Why not needed???
  COUNT(*) Total,
  SUM(CASE WHEN a.Score > 0 THEN 1 ELSE 0 END) * 100.0 / COUNT(*) Perc
FROM Posts q
LEFT JOIN Posts a ON q.AcceptedAnswerId = a.Id
WHERE q.ClosedDate BETWEEN @Start AND @END

Enter Parameters

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