MS SQL 2000

create table #call_id_list
(
    call_id_id            numeric               identity,
    call_id numeric
)

/*
insert into the temp table...
*/


/*
write a query, joining the temp table, and order by the call_id_id
*/

select
*
from
tbl_calls c inner join
#call_id_list l on
c.call_id = l.call_id
order by 
call_id_id 


Scott Thornton, Programmer
Application Development
Information Services and Telecommunications
Hunter-New England Area Health Service
Phone  RNH +61 2 49236078
Fax       +61 2 49236076

[EMAIL PROTECTED]

>>> [EMAIL PROTECTED] 5/04/2005 1:31:07 pm >>>
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