[thelist] Ordering a recordset by an array

Ben Gustafson Ben_Gustafson at lionbridge.com
Tue Oct 14 11:04:07 CDT 2003


Hello All,

I'm trying to figure out how to order a recordset according to the order of
elements in an array. For example, say I have three numbers in the following
order: 15,7,10. What I want to do is something like:

    select * from my_table where id in (15,7,10)

and put the records in the order of the three numbers, so that the record
with an id of 15 is first, and the one with an ID of 7 is second, etc. The
numbers will be pulled from a text file using the FileSystemObject in ASP
Classic. I am using JavaScript as my server-side scripting language.

Any ideas?

Thanks,

--Ben


More information about the thelist mailing list