|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
ORDER BY in query
Is there any way to order a query on a secondary level? Here is my current query...
<cfquery name = "results" datasource = "#request.dsn#"> SELECT * FROM results WHERE round_#this_round# IS NOT NULL ORDER BY total_score DESC </cfquery> which orders the results query by total_score (a numeric field). However, in certain situations there is more than one team tied on the same score. When this happens I want to order alphabetically by team_name (a text field). Any ideas? TIA Mark |
|
#2
|
|||
|
|||
|
you can build up your order by's by writing them as a comma delimited list.
you should really look for a good SQL book , this would have been coverd in the basics. <cfquery name = "results" datasource = "#request.dsn#"> SELECT * FROM results WHERE round_#this_round# IS NOT NULL ORDER BY total_score DESC, team_name DESC </cfquery> |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > ORDER BY in query |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|