Re: Order question

From: "Mitch Vincent" <mitch(at)venux(dot)net>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Order question
Date: 2001-02-13 22:58:35
Message-ID: 001301c09610$7ea17ed0$0200000a@windows
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

A further extension of this..

What might I be able to additionally order by so that the most recently
updated rows get ordered above everything else (within the order by
ordernum).. Using the same example :

> ordernum | fieldname | oid
> ----------+---------------+---------
> 1 | J.jobtitle | 1197126
> 1 | J.inv_id | 1197125
> 2 | J.updatedon | 1197127
> 3 | J.empinitials | 1197128

I just set the row with j.inv_id to 1, I'd like it to be ordered above the
row with j.jobtitle in it -- is that possible?

Thanks again!

-Mitch

----- Original Message -----
From: "Mitch Vincent" <mitch(at)venux(dot)net>
To: <pgsql-general(at)postgresql(dot)org>
Sent: Tuesday, February 13, 2001 5:54 PM
Subject: Order question

> Hey guys, another strange question here..
>
> If I query and order by a field and there are duplicate values in that
> field, what makes one return before the other? Just the first one that PG
> comes to on the disk is displayed first or is something else looked at to
> determine the order?
>
> Example :
>
> hhs=# SELECT ordernum,fieldname,oid from resultstyle WHERE style_id=1001
> order by ordernum asc;
> ordernum | fieldname | oid
> ----------+---------------+---------
> 1 | J.jobtitle | 1197126
> 1 | J.inv_id | 1197125
> 2 | J.updatedon | 1197127
> 3 | J.empinitials | 1197128
>
>
> What makes the record with j.jobtitle appear above te other, when ordernum
> is the same?
>
> Thanks!
>
> -Mitch
>
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Hiroshi Inoue 2001-02-13 23:10:38 Re: Re: numeric type and odbc from access 2000
Previous Message Mitch Vincent 2001-02-13 22:54:08 Order question