Created
December 2, 2011 00:12
-
-
Save oliyoung/1420891 to your computer and use it in GitHub Desktop.
Competition selection query
This file contains hidden or 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 concat(users.first_name, ' ', users.last_name) as 'name', users.postcode, convert_tz(entries.created_at, '-08:00', '+10:30') as 'entered at' | |
from entries | |
left join users on users.id = entries.user_id | |
where convert_tz(entries.created_at, '-08:00', '+10:30') > '2011-08-14' | |
and convert_tz(entries.created_at, '-08:00', '+10:30') < '2011-12-01' | |
and users.is_admin = 0 | |
and users.email not like '%qwoff%' | |
and users.email not like '%winecru%' | |
and users.email not like '%vinomofo%' | |
order by rand() | |
limit 20 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment