Skip to content

Instantly share code, notes, and snippets.

@maxiluckiesgin
Created August 12, 2019 08:44
Show Gist options
  • Save maxiluckiesgin/728168ca43a793fd36cde437dacbdaa1 to your computer and use it in GitHub Desktop.
Save maxiluckiesgin/728168ca43a793fd36cde437dacbdaa1 to your computer and use it in GitHub Desktop.
Write a query that selects userId and average session duration for each user who has more than one session.
SELECT userid, avg(duration) FROM sessions GROUP BY userid HAVING COUNT(userid) > 1;
@iriss-bit
Copy link

thank u

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment