Reputation: 83313
Is there any way to query a Cursor
with the content sorted based on the row's relationship between two columns?
For example, if I had two columns in my table:
is there any way I query a Cursor
with the data sorted based on the "shot percentage" (i.e. made/attempted)?
Upvotes: 0
Views: 448
Reputation: 83313
Note that in order to get accurate sorting, you might need to cast to DOUBLE
(the above suggestions does integer division which didn't provide correct results in all cases):
ORDER BY CAST(ShotsMade AS DOUBLE)/ShotsAttempted DESC
Upvotes: 2