Re: How can I group all children by their parent ? - Mailing list pgsql-general

From D'Arcy J.M. Cain
Subject Re: How can I group all children by their parent ?
Date
Msg-id 20140717094853.041ae078@druid.net
Whole thread Raw
In response to Re: How can I group all children by their parent ?  (Arup Rakshit <aruprakshit@rocketmail.com>)
List pgsql-general
On Thu, 17 Jul 2014 21:28:14 +0800
Arup Rakshit <aruprakshit@rocketmail.com> wrote:
> ORDER BY parent_id, id ?

> parent_id .. But why order_by.. I thought I need to group by

Perhaps you need to tell us what your problem is instead of your
solution.  What exactly are you trying to accomplish here?  Don't
describe it in database terms.  Tell us what the real world situation
is and what result you want to see.  For example;

I have a list of people related to each other in a parent/child
relationship to any level (e.g. parents, grandparents, etc.) and I want
to list everyone who is a descendant of anyone in the database.

Try for that level of detail and you will probably get more useful
answers.  Also, see http://www.catb.org/~esr/faqs/smart-questions.html
for some useful hints on asking questions.

--
D'Arcy J.M. Cain <darcy@druid.net>         |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 788 2246     (DoD#0082)    (eNTP)   |  what's for dinner.
IM: darcy@Vex.Net, VoIP: sip:darcy@druid.net


pgsql-general by date:

Previous
From: David G Johnston
Date:
Subject: Re: How can I group all children by their parent ?
Next
From: Adrian Klaver
Date:
Subject: Re: Why pg_toast table not get auto vacuumed?