Skip to content

Instantly share code, notes, and snippets.

@ariejan
Created November 14, 2008 15:06
Show Gist options
  • Save ariejan/24938 to your computer and use it in GitHub Desktop.
Save ariejan/24938 to your computer and use it in GitHub Desktop.
SELECT `articles`.*, `priorities`.position
FROM `articles`
LEFT OUTER JOIN `priorities` ON priorities.article_id = articles.id
WHERE (`articles`.`status` = 1)
ORDER BY priorities.position ASC, created_at DESC LIMIT 0, 20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment