create table #VotesWH ( VoteId int, UserId int, PostId i...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Role-playing Games

Q&A for gamemasters and players of tabletop, paper-and-pencil role-playing games

-- Enter Query Title
-- Enter Query Description

create table #VotesWH (
VoteId int,
UserId int,
PostId int,
VoteType int,
VoteCreationDate datetime,
BountyAmount int,
UserCreationDate datetime,
Reputation int,
UpVotes_ttl int,
DownVotes_ttl int,
AgeDays int,
AgeWeek int,
AgeMonth int
)
insert into #VotesWH select
v.Id,
v.UserId,
v.PostID,
v.VoteTypeId,
v.CreationDate,
v.BountyAmount,
u.CreationDate,
u.Reputation,
u.UpVotes,
u.DownVotes,
datediff(dd, u.CreationDate, v.CreationDate),
datediff(ww, u.CreationDate, v.CreationDate),
datediff(mm, u.CreationDate, v.CreationDate)
from Users u join Votes v on u.Id = v.UserId

select
count(*) as CountVotes,
(select count(*) from Users) as CountUsers
from #VotesWH

Enter Parameters

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