Users' upvotes

0

Please login or register to vote for this query.

(click on this box to dismiss)

A bit more unbiased insight than reputation

Android Enthusiasts Meta

Q&A about the site for enthusiasts and power users of the Android operating system

--Users' upvotes
--A bit more unbiased insight than reputation

Create Table #VoteChanges (
  [UID] int not null,
  [totalUpVotes] int null,
 -- [totalQueUpvotes] int null,
 -- [totalAnsUpVotes] int null,
  [userUpVotes] int null,
  [userDownVotes] int null,
--  [userLocation] nvarchar(100) null,
  [userViews] int null,
  [userReputation] int null
  
)

Insert Into #VoteChanges

select Users.Id as [UID],
 sum(case when VoteTypeId=2 then 1 end) as [totalUpvotes],
-- sum(case when VoteTypeId=2 and PostTypeId=1 then 1 end) as [totalQueUpvotes], 
-- sum(case when VoteTypeId=2 and PostTypeId=2 then 1 end) as [totalAnsUpvotes],
 Users.UpVotes as [userUpVotes],
 Users.DownVotes as [userDownVotes],
-- Users.Location as [userLocation],
 Users.Views as [userViews],
 Users.Reputation as [userReputation]
from Votes inner join Posts on Posts.Id=Votes.PostId 
 inner join Users on Users.Id=Posts.OwnerUserId
where (posts.Tags LIKE '%tensorflow%') 
group by Users.Id, users.UpVotes, users.DownVotes, users.Views, users.Reputation
order by totalUpvotes desc

-----------------

select UID, totalUpVotes, userUpVotes, userDownVotes, userViews, userReputation

from  #VoteChanges
where totalUpVotes > 0
order by totalUpvotes desc

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results