Created
January 23, 2018 23:09
-
-
Save anonymous/258a56456c29bae7dfe5564376f1f0ef to your computer and use it in GitHub Desktop.
TryCF Gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
/* Create an unsorted CF-query */ | |
unsorted = QueryNew("col1,col2,col3,col4","VarChar,VarChar,Integer,VarChar"); | |
for ( a=10; a >= 1; a-- ) { | |
QueryAddRow(unsorted); | |
QuerySetCell(unsorted,"col1","col1 #a#"); | |
QuerySetCell(unsorted,"col2","col2 #a#"); | |
QuerySetCell(unsorted,"col3","#a#"); | |
QuerySetCell(unsorted,"col4","col4 #a#"); | |
} | |
writeDump(var="#unsorted#"); | |
sorted = queryExecute( | |
"select [col1],[col2] from unsorted order by [col3], [col4] asc", {}, { dbtype="query" } | |
); | |
writeDump(var="#sorted#", label="sorted"); | |
</cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment