pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Bug with ORDER BY expression [ ASC | DESC ] ?
3+ messages / 2 participants
[nested] [flat]

* Bug with ORDER BY expression [ ASC | DESC ] ?
@ 1970-01-01 00:00 Christoph Haller <ch@rodos.fzk.de>
  2002-05-22 13:56 ` Re: Bug with ORDER BY expression [ ASC | DESC ] ? Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 3+ messages in thread

From: Christoph Haller @ 1970-01-01 00:00 UTC (permalink / raw)
  To: pgsql-sql

Hi, 
I am doing the following select in PostgreSQL 7.2.1 

select distinct on (o.sid,o.timepoint,o.lid,o.mid) o.sid,o.timepoint,o.lid,o.mid,o.value 
from onfvalue o, tempreftime t 
where o.sid=t.sid and o.timepoint=t.timepoint and o.lid=t.lid and o.mid=t.mid 
order by o.sid,o.timepoint,o.lid,o.mid,o.entrancetime desc;

but the result is coming in ascending order. 
There is no difference to 

select distinct on (o.sid,o.timepoint,o.lid,o.mid) o.sid,o.timepoint,o.lid,o.mid,o.value 
from onfvalue o, tempreftime t 
where o.sid=t.sid and o.timepoint=t.timepoint and o.lid=t.lid and o.mid=t.mid 
order by o.sid,o.timepoint,o.lid,o.mid,o.entrancetime asc; 

Is this a bug or am I missing something? 
Regards, Christoph 




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Bug with ORDER BY expression [ ASC | DESC ] ?
  1970-01-01 00:00 Bug with ORDER BY expression [ ASC | DESC ] ? Christoph Haller <ch@rodos.fzk.de>
@ 2002-05-22 13:56 ` Tom Lane <tgl@sss.pgh.pa.us>
  1970-01-01 00:00   ` Re: Bug with ORDER BY expression [ ASC | DESC ] ? Christoph Haller <ch@rodos.fzk.de>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2002-05-22 13:56 UTC (permalink / raw)
  To: Christoph Haller <ch@rodos.fzk.de>; +Cc: pgsql-sql

Christoph Haller <ch@rodos.fzk.de> writes:
> select distinct on (o.sid,o.timepoint,o.lid,o.mid) o.sid,o.timepoint,o.lid,o.mid,o.value 
> from onfvalue o, tempreftime t 
> where o.sid=t.sid and o.timepoint=t.timepoint and o.lid=t.lid and o.mid=t.mid
> order by o.sid,o.timepoint,o.lid,o.mid,o.entrancetime desc;

> but the result is coming in ascending order. 

Perhaps you meant to say

order by o.sid desc, o.timepoint desc, o.lid desc, o.mid desc, o.entrancetime desc;

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Bug with ORDER BY expression [ ASC | DESC ] ?
  1970-01-01 00:00 Bug with ORDER BY expression [ ASC | DESC ] ? Christoph Haller <ch@rodos.fzk.de>
  2002-05-22 13:56 ` Re: Bug with ORDER BY expression [ ASC | DESC ] ? Tom Lane <tgl@sss.pgh.pa.us>
@ 1970-01-01 00:00   ` Christoph Haller <ch@rodos.fzk.de>
  0 siblings, 0 replies; 3+ messages in thread

From: Christoph Haller @ 1970-01-01 00:00 UTC (permalink / raw)
  To: tgl@sss.pgh.pa.us; +Cc: pgsql-sql

> 
> Christoph Haller <ch@rodos.fzk.de> writes:
> > select distinct on (o.sid,o.timepoint,o.lid,o.mid) o.sid,o.timepoint,o.lid,o.mid,o.value 
> > from onfvalue o, tempreftime t 
> > where o.sid=t.sid and o.timepoint=t.timepoint and o.lid=t.lid and o.mid=t.mid
> > order by o.sid,o.timepoint,o.lid,o.mid,o.entrancetime desc;
> 
> > but the result is coming in ascending order. 
> 
> Perhaps you meant to say
> 
> order by o.sid desc, o.timepoint desc, o.lid desc, o.mid desc, o.entrancetime desc;
> 
> 
Indeed. Thanks, Christoph 



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2002-05-22 13:56 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1970-01-01 00:00 Bug with ORDER BY expression [ ASC | DESC ] ? Christoph Haller <ch@rodos.fzk.de>
2002-05-22 13:56 ` Tom Lane <tgl@sss.pgh.pa.us>
1970-01-01 00:00   ` Christoph Haller <ch@rodos.fzk.de>

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