Skip site navigation (1) Skip section navigation (2)

Re: [GENERAL] Problem with getting the right order

From: dustin sallings <dustin(at)spy(dot)net>
To: Henrik Pedersen <HenrikP(at)mail(dot)ikasths(dot)dk>
Cc: pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] Problem with getting the right order
Date: 1998-10-22 04:28:10
Message-ID: Pine.NEB.4.02.9810212119090.393-100000@dhcp-199.west.spy.net (view raw or flat)
Thread:
Lists: 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(at)spy(dot)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. __


In response to

pgsql-general by date

Next:From: Peter T MountDate: 1998-10-22 05:33:27
Subject: Re: [GENERAL] jdbc + postgres
Previous:From: Alvaro CastilloDate: 1998-10-22 04:02:13
Subject: CORBA and PostgreSQL

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group