Hi,
Yes, in MySQL you can go
select handle, sum(total) as t group by handle order by t;
in ANSI (?) you can go
select handle, sum(total) group by handle order by 2;
2 being the column number of the result.
Regards
Quentin
-----Original Message-----
From: Curtis Maurand [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 20 March 2001 4:28 p.m.
To: MySQL List
Subject: [OT] SQL syntax qestion
Hi,
Just a quick quesiton, I have a table that contains difined as
create table picks(
handle char(30) primary key,
<...>
total int unsigned);
there is a user table that has a list of handles and other user info.
handle is the primary key.
If I issue the command "select handle, sum(total) group by handle;" I
get the information that I'm looking for, however I'd like to sort it by
the sum that I get. Is there a way of accomplishing this?
Curtis
The information contained in this email is privileged and confidential
and intended for the addressee only. If you are not the intended
recipient, you are asked to respect that confidentiality and not
disclose, copy or make use of its contents. If received in error
you are asked to destroy this email and contact the sender immediately.
Your assistance is appreciated.
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php