Showing posts with label order by. Show all posts
Showing posts with label order by. Show all posts

20 October 2009

Odd bug in Query of Queries

Not sure if this is a known bug or if it will really help anyone but it stumped me for a bit. As you can see ordering of uppercase values is handled completely differently than lowercase values! Frustrating.


cfscript
hello = queryNew('lastname,firstname');
queryAddRow(hello);
querySetcell(hello,'lastname','YANKEE');
querySetcell(hello,'firstname','DOODLE');
queryAddRow(hello);
querySetcell(hello,'lastname','ableson');
querySetcell(hello,'firstname','abe');
/cfscript
cfdump var="#hello#"



cfquery name="qhello" dbtype="query"
select lastname, firstname from hello
order by lastname,firstname
/cfquery
cfdump var="#qhello#"






Obviously the solution is "select lower(lastname), lower(firstname) from"....

I'd love to see CFML improve query of queries, it is a useful tool.