Created
March 31, 2011 12:40
-
-
Save kernow/896286 to your computer and use it in GitHub Desktop.
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 | |
`archive_messages`.`id` AS `id`, | |
`archive_messages`.`body` AS `body`, | |
`archive_messages`.`utc` AS `created_at`, | |
`users`.id AS `user_id`, | |
`questions`.id AS `question_id` | |
FROM | |
archive_collections | |
INNER JOIN archive_messages | |
ON archive_collections.id = archive_messages.coll_id | |
INNER JOIN users | |
ON users.login_name = SUBSTRING_INDEX(archive_collections.us, '@', 1) | |
INNER JOIN questions | |
ON questions.cached_slug = archive_collections.with_user | |
WHERE | |
archive_collections.with_server LIKE 'conference.%' | |
AND SUBSTRING_INDEX(archive_collections.us, '@', 1) = SUBSTRING_INDEX(archive_messages.name, '_____', 1) | |
AND archive_collections.id = archive_messages.coll_id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment