Re: Ltree - how to sort nodes on parent node

Поиск
Список
Период
Сортировка
Искать
От
Alban Hertroys
Тема
Re: Ltree - how to sort nodes on parent node
Дата
Msg-id
BB80D221-44CC-4174-9576-5032C0FF398F@solfertje.student.utwente.nl
Ответ на
Список
Дерево обсуждения
Re: Ltree - how to sort nodes on parent node Harald Fuchs <hari.fuchs@gmail.com>
Re: Ltree - how to sort nodes on parent node Alban Hertroys <dalroi@solfertje.student.utwente.nl>
On 19 Apr 2010, at 9:23, cojack wrote:

> Hello,

> id |                     path                      | sort                                                                                                   
> ----+-----------------------------------------------+------                                                                                                  
>  1 | Top                                           |    1                                                                                                   
>  2 | Top.Science                                   |    1                                                                                                   
>  3 | Top.Science.Astronomy                         |    1                                                                                                   
>  4 | Top.Science.Astronomy.Astrophysics            |    1                                                                                                   
>  5 | Top.Science.Astronomy.Cosmology               |    2                                                                                                   
>  6 | Top.Hobbies                                   |    2                                                                                                   
>  7 | Top.Hobbies.Amateurs_Astronomy                |    2                                                                                                   
>  8 | Top.Collections                               |    3
>  9 | Top.Collections.Pictures                      |    1
> 10 | Top.Collections.Pictures.Astronomy            |    1
> 11 | Top.Collections.Pictures.Astronomy.Stars      |    1
> 12 | Top.Collections.Pictures.Astronomy.Galaxies   |    2
> 13 | Top.Collections.Pictures.Astronomy.Astronauts |    3
> 15 | Top.Science.Programing                        |    3


It would help if you'd show us what result you expect from ordering the above.

Most people would order this by path I think. However that doesn't match your sort column and I can't think of any method that would give results in such an arbitrary order as you seem to be specifying - unless you set it by hand like you do.

Alban Hertroys

--
Screwing up is an excellent way to attach something to the ceiling.


!DSPAM:737,4bcc9b1e10415135793547!


В списке pgsql-general по дате отправления
От: Tom Lane
Дата:
От: Bruce Momjian
Дата:
Сообщение: Re: Int64GetDatum
FAQ