Created
November 2, 2018 04:11
-
-
Save jameslittle230/18d83d350d74a197c39769e01a4a646d to your computer and use it in GitHub Desktop.
Almost-done query
This file contains 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 | |
article.id, | |
date, | |
title, | |
excerpt, | |
body | |
from | |
article LEFT JOIN ( | |
select id, article_id, body, max(timestamp) from articlebody | |
group by article_id | |
ORDER BY timestamp DESC | |
limit 300 | |
) articlebody ON article.id = articlebody.article_id | |
WHERE published = 1 | |
ORDER BY date DESC | |
LIMIT 50 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment