The result needs to be sorted by date of most recent reply descending
(replying bumps the thread) but also need to be sorted such that the
parent/child relationships are maintained. Multiple replies on the same
level also need to be sorted by date desc.
Getting the parent/child sorting can be a
I am trying to select nested comments from a table with this structure
CREATE TABLE picture_comments
(
comment_id serial NOT NULL,
user_id integer NOT NULL,
"comment" text NOT NULL DEFAULT ''::text,
comment_date timestamp without time zone NOT NULL DEFAULT now(),