Search Postgresql Archives

Re: How can I group all children by their parent ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 17 Jul 2014 21:28:14 +0800
Arup Rakshit <aruprakshit@xxxxxxxxxxxxxx> 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@xxxxxxxxx>         |  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@xxxxxxx, VoIP: sip:darcy@xxxxxxxxx



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux