Re: [GENERAL] Query to select nested comments sorted by nesting and date

2011-06-23 Thread David Johnston
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

[GENERAL] Query to select nested comments sorted by nesting and date

2011-06-23 Thread Cstdenis
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(),