Skip to content

Instantly share code, notes, and snippets.

@henrikbjorn
Created February 9, 2009 16:50
Show Gist options
  • Save henrikbjorn/60860 to your computer and use it in GitHub Desktop.
Save henrikbjorn/60860 to your computer and use it in GitHub Desktop.
SELECT `Message`.`id`, `Message`.`user_id`, `Message`.`sender_id`, `Message`.`status`, `Message`.`title`, `Message`.`body`, `Message`.`parent_id`, `Message`.`created`, `Message`.`modified`, `Sender`.`id`, `Sender`.`username`, `Sender`.`password`, `Sender`.`created`, `Sender`.`modified`, `Sender`.`active`, `Sender`.`validate_key`, `Sender`.`email`, `Sender`.`status`, `User`.`id`, `User`.`username`, `User`.`password`, `User`.`created`, `User`.`modified`, `User`.`active`, `User`.`validate_key`, `User`.`email`, `User`.`status` FROM `messages` AS `Message` LEFT JOIN `users` AS `Sender` ON (`Message`.`sender_id` = `Sender`.`id`) LEFT JOIN `users` AS `User` ON (`Message`.`user_id` = `User`.`id`) WHERE (`Message`.`user_id` = 11 OR `Message`.`sender_id` = 11) AND ((`Message`.`status` & 8) = 0) ORDER BY `Message`.`modified` DESC, `Message`.`status` DESC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment