Q&A for users and developers of hardware and software for Raspberry Pi
with firstquery as (select userid,count(posts.id) count,max(creationdate) MaxDAte from badges join posts on badges.userid = posts.owneruserid where Name = 'Socratic' and posttypeid = 1 and creationdate >= '20170101' and creationdate <= '20170531' group by userid ) select userid,count,MaxDate from firstquery order by count desc select * from posts where owneruserid =39677 and posttypeid = 1 and creationdate >= '20170101' and creationdate <= '20170531'