SELECT cast(v.creationdate as date) as creation_date, SUM...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

SELECT 
    cast(v.creationdate as date) as creation_date,
    --COUNT( Case when v.VoteTypeId = 2 then 1 end) AS UpVotes,
    --COUNT( Case when v.VoteTypeId = 3 then 1 end) AS DownVotes,
    SUM( Case when v.VoteTypeId =2 then 1 when v.VoteTypeId = 3 then -1 end) AS NetVotes
FROM PostFeedback as v
    INNER JOIN Posts ON v.PostId = Posts.Id -- and (v.VoteTypeId = 2 or v.VoteTypeId=3)
WHERE 
    v.isanonymous = 1 and 
    Posts.Id in (
101337,
1072540,
1077413,
10810,
109553,
1111193,
111386,
1120575,
112396,
116876,
119336,
120131,
126720,
134099,
138432,
138705,
139199,
1400533,
1402770,
144696,
145025,
149848,
1512218,
155241,
1650941,
165808,
167199,
1672530,
16861,
169222,
171519,
172223,
172486,
172739,
173329,
18034,
1805838,
184112,
187655,
187736,
188266,
18943,
189555,
194397,
198520,
199252,
20088,
211169,
216110,
22135,
224049,
228138,
240283,
243646,
24723,
247304,
252180,
252226,
256172,
273396,
277044,
27972,
28599,
286090,
29399,
295345,
295628,
306668,
311243,
31326,
328,
329500,
329658,
338385,
34079,
342378,
3437,
34573544,
34632744,
34896,
34979509,
35183488,
351873,
353880,
36032534,
36167750,
36877,
371921,
381171,
38875,
4065657,
41107,
420843,
427598,
43459,
44509,
45093,
454048,
454355,
459248,
46029,
460519,
4727226,
4753643,
479701,
489950,
4911,
49547,
502218,
512985,
517575,
521101,
538435,
5408971,
54200,
545667,
55643,
558360,
563037,
574159,
58621,
5925954,
60174,
6190381,
6463152,
667177,
670398,
674904,
710805,
71944,
727421,
73781,
75057,
7551,
770635,
776679,
800827,
81361,
81991,
841957,
8472,
869320,
88311,
88646,
942011,
950928,
98074,
99553)
GROUP BY cast(v.creationdate as date)
ORDER BY creation_date asc
-- ORDER BY UpVotes DESC

Enter Parameters

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