I have the following table:
CREATE TABLE post (
id bigint primary key,
thread_id bigint,
is_notice boolean,
title text,
content text
)
I display the list using the following query:
SELECT * FROM post ORDER BY is_notice desc, thread_id desc, id
Then, given the post selected by id(i.e. SELECT * FROM post where id=3
), how do I retrieve the next and previous posts?
WHERE
clause, you return all rows from the table, there is no next or previous. Could you explain a bit better?