pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: phansen <phansen@idir.net>
To: pgsql-sql@postgreSQL.org
Subject: grouping a ordered list
Date: Sat, 03 Oct 1998 11:50:57 +0500
Message-ID: <3615C951.EAAA75DE@idir.net> (raw)

I am running postgresql6.3.2 on a SPARC20 with Solaris 2.6. and
have a table named tsv with

ttime abstime,
dtime abstime,
prmid int4,
val float,
com char,
qual char,
valid char

I would like to order by dtime ASC, prmid ASC, and ttime DESC then
group by dtime,prmid,ttime.

When I submit

select * from tsv group by dtime,prmid,ttime order ASC, prmid ASC, ttime
DESC;

grouping occurs before ordering.  How can I change this?  Can the
ordering be performed
on a sub select then group it?


Thanks in advance,

Paul Hansen




Message-ID: <3615C951.EAAA75DE@idir.net>
Permalink:  ../3615C951.EAAA75DE@idir.net/
Also on:    postgresql.org/message-id/3615C951.EAAA75DE@idir.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: phansen@idir.net
  Subject: Re: grouping a ordered list
  In-Reply-To: <3615C951.EAAA75DE@idir.net>
  References: <3615C951.EAAA75DE@idir.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox