Created
August 25, 2009 19:55
-
-
Save jkatz/174973 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT avg(sub.c) FROM ( | |
SELECT count(DISTINCT split_part(email_address, '@', 2)) AS c | |
FROM guests | |
JOIN events ON events.id = guests.event_id JOIN contacts ON guests.contact_id = contacts.id | |
GROUP BY events.id | |
) AS sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment