smr/src/sql/select_post.sql

17 lines
244 B
SQL

/*
Select the data we need to read a story (and maybe display an edit button)
*/
SELECT
post_title,
post_text,
posts.authorid,
posts.isanon,
authors.name,
views
FROM
posts,authors
WHERE
posts.authorid = authors.id AND
posts.id = :id;