From: | "omid omoomi" <oomoomi(at)hotmail(dot)com> |
---|---|
To: | shrews(at)lssi(dot)net, pgsql-general(at)postgresql(dot)org |
Subject: | Re: [GENERAL] ORDER BY problems |
Date: | 2000-02-18 13:54:29 |
Message-ID: | 20000218215429.28393.qmail@hotmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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(at)lssi(dot)net>
>To: pgsql-general(at)postgresql(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | Uillian Fernandes | 2000-02-18 17:18:56 | PostGreSQL on Windows 9x/NT |
Previous Message | Lincoln Yeoh | 2000-02-18 07:40:51 | Re: [GENERAL] RE: postgresql and web transactions |