Emails for recent event attendees

I was tasked to produce a list of unique email addresses of CTL event attendees for events held Spring 2013.

Short answer:

select distinct first_name,last_name,email  from users left join enrollments on left join events on left join event_types on left join types on`type_id` left join event_sponsors on left join sponsors on`sponsor_id`    where events.start_day>’2012-12-31′ and is_facilitating=0 and (sponsors.sponsor IS NULL or sponsors.sponsor != “Writing in the Disciplines”) order by last_name

Long answer:


  1. No need to tag events: just need to filter start day where events.start_day>’2012-12-31′
  2. Some small effort was made to filter by sponsor (CTL, WID, etc.); however, sponsor was not specified for many events
  3. No effort was made to sponsor by event type (workshop, book group, etc.) as event type was not specified for many events

About Wesley Wright

Born on a mountain top near New York City, Craziest state in the land of the pretty. Raised in the woods so's he knew every tree, Killed him a bear when he was only three.
This entry was posted in Wes and tagged , . Bookmark the permalink.