Advertisement
ROMaster2

Trending SQL

Feb 13th, 2017
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.62 KB | None | 0 0
  1. SELECT Runs.GameID, RunsPlayers.UserID, MAX((2^(-2/30.4375))^(Now()-[RunDate])) AS RunActivity30, MAX((2^(-2/14))^(Now()-[RunDate])) AS RunActivity14
  2. FROM Runs INNER JOIN RunsPlayers ON Runs.RunID = RunsPlayers.RunID
  3. WHERE ((NOT (Runs.STATUS)="rejected"))
  4. GROUP BY Runs.GameID, RunsPlayers.UserID;
  5.  
  6. SELECT Example1.GameID, SUM(Example1.RunActivity30) AS GameActivity30, SUM(Example1.RunActivity14) AS GameActivity14, IIf([GameActivity30]>3,[GameActivity30]/[GameActivity14],9999) AS TrendRatio
  7. FROM Example1
  8. GROUP BY Example1.GameID;
  9.  
  10. SELECT Example2.GameID, Example2.TrendRatio
  11. FROM Example2
  12. ORDER BY Example2.TrendRatio;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement