Query formatting

I first thought that ORDER BY time ASC was missing because I didn't see it.
This commit is contained in:
ekzyis 2024-03-31 16:47:51 +02:00
parent 7786a7f6da
commit ecda7954ef
1 changed files with 2 additions and 1 deletions

3
sn.go
View File

@ -23,7 +23,8 @@ func CurateContentForStackerNews() (*[]Story, error) {
FROM hn_items
WHERE rank = 1 AND id NOT IN (SELECT hn_id FROM sn_items) AND length(title) >= 5
GROUP BY id
HAVING unixepoch(end) - unixepoch(start) >= 3600 ORDER BY time ASC
HAVING unixepoch(end) - unixepoch(start) >= 3600
ORDER BY time ASC
LIMIT 1
) t JOIN hn_items ON t.id = hn_items.id AND t.end = hn_items.created_at;
`); err != nil {