I was recently asked how to show a record for the current user before the record for other users - in one query. Here is my solution.
I am assuming that the id for the current user is stored in "Client.AdminID". Hopefully it will be easy to modify this example to meet multiple needs.
You could use this technique to sort by a list as well.
If you have a list called "adminsort" that held the values of the admins in the order in which you wish to sort them, you could do this:
<cfloop index="i" from="1" to="#ListLen(adminsort)#" step="1">
<cfset AdminID = ListGetAt(adminsort,i)>
WHEN admin_id = #Val(AdminID)# THEN #i#
<cfset i = i + 1>
END AS SortVal
ORDER BY SortVal, LastName
I don't know if this would perform well, but it should work.
In my next DataMgr presentation, I plan to show how DataMgr can simplify that task.