Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DECLARE @PERIOD_BEGIN NVARCHAR(20) = '2020-1-11 22:00:00'; --начало анализированного периода
- DECLARE @PERIOD_END NVARCHAR(20) = '2020-1-13 9:59:59'; -- конец анализированного периода
- --declare @days int = 999999
- select
- count(distinct tutorial.userid) users
- from tutorial join users on users.userid=tutorial.userid where step_id=999 and registrationclientversion='0.0.79' and tutorial.created between @PERIOD_BEGIN and @PERIOD_END
- select
- worldid,
- avg(runnumber) as tries
- ,count(distinct finishrun.userid) Users
- ,count(finishrun.userid) Повторные_прохождения
- from finishrun join users on users.userid=finishrun.userid where roomnumber='-1' and timestamp between finishrun.created and dateadd(hh,1,finishrun.created)
- and registrationclientversion='0.0.79' and finishrun.created between @PERIOD_BEGIN and @PERIOD_END and isleft=0 and roomname!='-2' and roomnumber!=0
- group by worldid
- order by worldid
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement