471,049 Members | 1,438 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,049 software developers and data experts.

Order By within Group By

I want to return the results of a series of races, and display them in their
final placing (1st, 2nd 3rd etc, which is determined by a total_seconds time
field) within each race (which will take place on different event_date
days).
$Query="SELECT * FROM events GROUP BY event_date ORDER BY total_seconds";
won't cut it (even I can see why!) but I can't think how to.
I suppose I *could* go to two tables and JOIN but I'd rather use just one
line of code if that's possible.
Can anyone help?
TIA.
------------------------------------------------------------

This post did not necessarily reflect my opinions. So there.

Sent from within Forte's Agent.

Pull the pins out to reply direct.
Jul 20 '05 #1
2 3045
"Fat Bloke" <fa****************@pinsjohnstone-wheelers.co.uk> wrote in
message
I want to return the results of a series of races, and display them in their final placing (1st, 2nd 3rd etc, which is determined by a total_seconds time field) within each race (which will take place on different event_date
days).
$Query="SELECT * FROM events GROUP BY event_date ORDER BY total_seconds";
won't cut it (even I can see why!) but I can't think how to.
I suppose I *could* go to two tables and JOIN but I'd rather use just one
line of code if that's possible.
Can anyone help?


Would this work

$Query="SELECT * FROM events ORDER BY event_date, total_seconds";
Jul 20 '05 #2
On Tue, 25 May 2004 16:34:24 GMT, "Siemel Naran"
<Si*********@REMOVE.att.net> wrote:
"Fat Bloke" <fa****************@pinsjohnstone-wheelers.co.uk> wrote in
message
I want to return the results of a series of races, and display them in

their
final placing (1st, 2nd 3rd etc, which is determined by a total_seconds

time
field) within each race (which will take place on different event_date
days).
$Query="SELECT * FROM events GROUP BY event_date ORDER BY total_seconds";
won't cut it (even I can see why!) but I can't think how to.
I suppose I *could* go to two tables and JOIN but I'd rather use just one
line of code if that's possible.
Can anyone help?


Would this work

$Query="SELECT * FROM events ORDER BY event_date, total_seconds";

This is Awwwful.... Yes, it does.
I think I was being too smart for my own good before. Ho-hum.
Thanx!
------------------------------------------------------------

This post did not necessarily reflect my opinions. So there.

Sent from within Forte's Agent.

Pull the pins out to reply direct.
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by entoone | last post: by
10 posts views Thread by Chris Gordon-Smith | last post: by
2 posts views Thread by Al Reid | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.