SELECT DATENAME(WEEKDAY, CreationDate) AS Day, COUNT(*) A...

0

Please login or register to vote for this query.

(click on this box to dismiss)

History of Science and Math

Q&A for people interested in the history and origins of science and mathematics

SELECT 
    DATENAME(WEEKDAY, CreationDate) AS Day, 
    COUNT(*) AS Amount, 
    SUM(CASE WHEN VoteTypeId = 2 THEN 1 ELSE 0 END) AS UpVotes, 
    SUM(CASE WHEN VoteTypeId = 3 THEN 1 ELSE 0 END) AS DownVotes, 
    (CAST(SUM(CASE WHEN VoteTypeId = 2 THEN 1 ELSE 0 END) AS float) / CAST(SUM(CASE WHEN VoteTypeId = 3 THEN 1 ELSE 0 END) AS float)) AS UpVoteDownVoteRatio
FROM Votes
GROUP BY DATENAME(WEEKDAY, CreationDate)
ORDER BY UpVoteDownVoteRatio DESC

Enter Parameters

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