|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Help with query
I am have an part of my game where you number can be anywhere from -99999999 (meaning you are a devil) to 99999999 (angel) and so on... i want to list the top 5 who has the most in each (positives and negatives)
the only way i can figure out how to do it (and it still doesnt work entirely) is: <cfquery name="get_devils" datasource="userlogin"> SELECT alignment, user_ID, user_name from Battle where alignment = 'devil' ORDER by alignmentamount </cfquery> <cfoutput query="get_dev" maxrows="5"> #user_name# </cfoutput> except its not working.. it shows like (in order) -35, -4534, -254, -3, -642 when it should be 4534,-642, -254, -35, -3 what should i do to make this work right how can i do this differently |
|
#2
|
|||
|
|||
|
Is aligment defined as a numeric value in your DB?
|
|
#3
|
|||
|
|||
|
If you do a cfdump of the query results, is it in the correct order? Is it possible your field is a string and not numeric, which would mess with the ordering?
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian. How to Post a Question in the Forums |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Help with query |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|