Re: [GENERAL] ORDER BY problems - Mailing list pgsql-general

From omid omoomi
Subject Re: [GENERAL] ORDER BY problems
Date
Msg-id 20000218215429.28393.qmail@hotmail.com
Whole thread Raw
List pgsql-general
hi,
As far as I understand,tracking_num is primary key and uniqe! So when you
sort the date by a uniqe field their would be no place for other fields to
be sort on! May be you are going to sort the data some other way.
so I think your query is doing well.
Omid Omoomi

>From: David Shrewsbury <shrews@lssi.net>
>To: pgsql-general@postgresql.org
>Subject: [GENERAL] ORDER BY problems
>Date: Fri, 18 Feb 2000 20:52:06 +0000
>
>I cannot seem to get ORDER BY to work properly when I
>want to sort using two different columns. I have code
>similar to the following:
>
>SELECT tracking_num, username
>FROM reports
>WHERE customer='$customer'
>ORDER BY tracking_num, username
>
>This will sort by tracking_num (int4, primary key), but
>NOT by the username (varchar, not null). The confusing thing
>is if I use:
>
>     ORDER BY username, tracking_num
>
>it works, but it sorts by username first and then the
>tracking number which is the reverse of what I want to do.
>Why doesn't the first bit of code work as I expect?
>
>-David
>
>************

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com


pgsql-general by date:

Previous
From: "Manuel Lemos"
Date:
Subject: Re: [GENERAL] RE: postgresql and web transactions
Next
From: "Dean Browett"
Date:
Subject: problems with memory