smr/src/sql/select_author_index.sql

19 lines
312 B
SQL

/* Get the data we need to display a particular author's latest stories */
SELECT
posts.id,
posts.post_title,
posts.post_time,
posts.views,
posts.unlisted,
posts.hash
FROM
posts,
authors
WHERE
posts.isanon = 0 AND
posts.authorid = authors.id AND
authors.name = :author
ORDER BY
posts.post_time DESC