From: | David Shrewsbury <shrews(at)lssi(dot)net> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | ORDER BY problems |
Date: | 2000-02-18 20:52:06 |
Message-ID: | 38ADB0F6.C0608C68@lssi.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
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
From | Date | Subject | |
---|---|---|---|
Next Message | Gary Horton | 2000-02-18 22:27:42 | newbie Q's |
Previous Message | Manuel Lemos | 2000-02-18 20:10:34 | Re: [GENERAL] RE: postgresql and web transactions |