how about this instead of a temp table?

<cfset IDs = "127,124,121,133,122,128,125,132">

<cfset query = querynew("ID")>
<cfloop index="i" list="#IDs#">
     <cfset QueryAddRow(query, 1)>
     <cfset QuerySetCell(query, "ID", #i#)>
</cfloop>

<cfquery name="sortedIDs" dbtype="query">
   SELECT * FROM query ORDER BY ID
</cfquery>


Pete



>>> [EMAIL PROTECTED] 5/04/2005 11:31 am >>>
doh! shoulda tested the code before replying... the Onnis method
returns the records out of order.... dammit
G

On Apr 5, 2005 1:27 PM, Mark Mandel <[EMAIL PROTECTED]> wrote:
> Could also build your case / iif statement dynaically as well..
prolly
> faster on your DB..
> 
> Just a thought o_O
> 
> Mark
> 
> On Apr 5, 2005 1:23 PM, grant <[EMAIL PROTECTED]> wrote:
> > K thanks everybody, i think i'm going to use the 'steve onnis'
method:
> >
> > <cfloop list="127,124,121,133,122,128,125,132" index="i">
> >
> >        SELECT  *
> >        FROM    tbl_calls,
> >        WHERE   call_id = #i#
> >
> >        <cfif i NEQ listLast(list)>
> >                UNION
> >        </cfif>
> >
> > </cfloop>
> >
> > all the other solutions weren't really workable - all the ids are
> > dynamically passed thru and are arbitrarily (sp?) ordered so using
> > ORDER BY or manually sorting them is practical.
> >
> > Thanks again!
> > G
> >
> > ---
> > You are currently subscribed to cfaussie as: [EMAIL PROTECTED]

> > To unsubscribe send a blank email to
[EMAIL PROTECTED] 
> > Aussie Macromedia Developers: http://lists.daemon.com.au/ 
> >
> 
> --
> E: [EMAIL PROTECTED] 
> W: www.compoundtheory.com 
> ICQ: 3094740
> 
> ---
> You are currently subscribed to cfaussie as: [EMAIL PROTECTED] 
> To unsubscribe send a blank email to
[EMAIL PROTECTED] 
> Aussie Macromedia Developers: http://lists.daemon.com.au/ 
>

---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]

To unsubscribe send a blank email to
[EMAIL PROTECTED] 
Aussie Macromedia Developers: http://lists.daemon.com.au/

---
You are currently subscribed to cfaussie as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/

Reply via email to