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

Поиск
Список
Период
Сортировка
От D'Arcy J.M. Cain
Тема Re: How can I group all children by their parent ?
Дата
Msg-id 20140717094853.041ae078@druid.net
обсуждение исходный текст
Ответ на Re: How can I group all children by their parent ?  (Arup Rakshit <aruprakshit@rocketmail.com>)
Список 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 по дате отправления:

Предыдущее
От: David G Johnston
Дата:
Сообщение: Re: How can I group all children by their parent ?
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: Why pg_toast table not get auto vacuumed?