Re: [GENERAL] Problem with getting the right order

Поиск
Список
Период
Сортировка
От Ulf Mehlig
Тема Re: [GENERAL] Problem with getting the right order
Дата
Msg-id 199810220850.KAA02168@uni-bremen.de
обсуждение исходный текст
Ответ на Problem with getting the right order  (Henrik Pedersen <HenrikP@mail.ikasths.dk>)
Список pgsql-general
Generally, something like

       select count(vnr), enr
       from votes
       group by err
       order by 1 desc

should work. But I tried it only with my own tables ... For
referencing to the first column of the resulting table ("order by 1")
you can also use

       select count(vnr) as the_count, [...]
       order by the_count desc

If you want to get reversed ordering (you said you'd like to get the
bigger numbers first), you have to specify "desc", default is "asc",
which will do it the other way round.

Hope it helps!
Ulf

--
======================================================================
 %%%%%            Ulf Mehlig              <ulf.mehlig@uni-bremen.de>
   %%%%!%%%       Projekt "MADAM"         <umehlig@uni-bremen.de>
%%%% %!% %%%%     ----------------------------------------------------
 ---| %%%         MADAM:  MAngrove    |  Center for Tropical Marine
    ||--%!%              Dynamics     |  Biology
    ||                  And           |  Fahrenheitstrasse 1
 _ /||\_/\_            Management     |
/  /    \  \ ~~~~~~~~~~~~~~~~~        |  28359 Bremen/Germany
  ~~~~~~~~~~~~~~~~~~~~

В списке pgsql-general по дате отправления:

Предыдущее
От: Peter T Mount
Дата:
Сообщение: Re: [GENERAL] CORBA and PostgreSQL
Следующее
От: Ulf Mehlig
Дата:
Сообщение: Re: [GENERAL] aggregate question