Re: [GENERAL] Problem with getting the right order - Mailing list pgsql-general

From dustin sallings
Subject Re: [GENERAL] Problem with getting the right order
Date
Msg-id Pine.NEB.4.02.9810212119090.393-100000@dhcp-199.west.spy.net
Whole thread Raw
In response to Problem with getting the right order  (Henrik Pedersen <HenrikP@mail.ikasths.dk>)
List pgsql-general
On Wed, 21 Oct 1998, Henrik Pedersen wrote:

// When i do a :
//
// ./psql -c "select count(vnr),enr from votes where cnr=1 group by enr"
// vote

// This is almost what i want, execpt that i want the result to be
// ordered by count, instead og enr. so that the entry, which got most
// votes is listed first

    You should slap an ``order by count'' at the end.  I think it'd be
``order by count(vnr)'' or you could alias it and order it by the alias.

// For example:
//
//    11|  1
//    10|  8
//     4|  4
//     1|  2
//     1|  3
//     1|  5
//     1|  6
//
//
//
// hope someone outthere can help me :)
//
// Henrik Pedersen
// Demark
//
//

--
SA, beyond.com                            The world is watching America,
pub  1024/3CAE01D5 1994/11/03 Dustin Sallings <dustin@spy.net>
|    Key fingerprint =  87 02 57 08 02 D0 DA D6  C8 0F 3E 65 51 98 D8 BE
L________________________________________ and America is watching TV. __


pgsql-general by date:

Previous
From: Alvaro Castillo
Date:
Subject: CORBA and PostgreSQL
Next
From: Peter T Mount
Date:
Subject: Re: [GENERAL] jdbc + postgres