Re: [GENERAL] Sorting with DISTINCT ON

2007-01-08 Thread Nico Grubert
It does allow you to sort on both columns. SELECT DISTINCT ON (path) path, comment_id, created, title FROM bewertungen.tblcomments ORDER BY path, created Thank you very much. Works perfect! :-) ---(end of broadcast)--- TIP 3: Have you

Re: [GENERAL] Sorting with DISTINCT ON

2007-01-08 Thread Jorge Godoy
Nico Grubert <[EMAIL PROTECTED]> writes: > My first try was this SQL query: > > SELECT DISTINCT ON (path) path, comment_id, created, title > FROM bewertungen.tblcomments > > This does not allow me to append "ORDER BY created" since I can only sort on > path because of DISTINCT ON (path). I

[GENERAL] Sorting with DISTINCT ON

2007-01-08 Thread Nico Grubert
Hi there, I have a problem sorting a SQL result if I use DISTINCT ON. I have a table "tblcomment" with these columns: id (serial) path (varchar) created (timestamp) title (varchar) These records are in the table "tblcomment": id pathcreated title --