Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

inner joins and ordering 1

Status
Not open for further replies.

peter11

Instructor
Mar 16, 2001
334
US
<cfquery name="goals" datasource ="paperfree">
select sproster.lastname, sproster.firstname , sum(spplayerstats.goal) as goaltot from sproster inner join spplayerstats on sproster.playerID = spplayerstats.playerID
group by sproster.lastname, sproster.firstname
</cfquery>

How would I order the above query in descending order of the sum of goals (goaltot)?

 
<cfquery name="goals" datasource ="paperfree">
select sproster.lastname, sproster.firstname , sum(spplayerstats.goal) as goaltot from sproster inner join spplayerstats on sproster.playerID = spplayerstats.playerID
group by sproster.lastname, sproster.firstname
order by sum(spplayerstats.goal) desc
</cfquery>


Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so.
-Douglas Adams (1959-2001)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top