select distinct op.op_id, op.op_namefrom op inner join (travd inner join travh on 
(travd.travd_id=
travh.travh_id)) on (travd.op_id = op_id)

Not sure if thats what your looking for, but it might spark some though
t.
CC


                                                                       
                                            
                    Gonzo Rock                                         
                                            
                    <GonzoRock           To:     CF-Talk <cf-talk@house
offusion.com>                               
                    @Excite.com>         cc:                           
                                            
                                         Subject:     Re: SQL Question 
                                            
                    12/21/01                                           
                                            
                    11:57 AM                                           
                                            
                    Please                                             
                                            
                    respond to                                         
                                            
                    cf-talk                                            
                                            
                                                                       
                                            
                                                                       
                                            




Hi Michael,

Well there is the association between the header and it's details, (a o
ne
to
 many) with the travh_id field in the travd file... I'm not sure I
 understand why it is REQUIRED... in fact I was thinking it was not
 recommended... but then... again I'm pretty new...

thanks,
GR

At 01:43 PM 12/20/01 -0600, you wrote:
>It looks like you need to add TravH_ID to the TravD table.  That way y
ou
>have the association between the header and its details:
>
>TravD_ID    TravH_ID
>1                    1
>2                    1
>3                    1
>
>etc.
>
>Then you can get it all with TravH_ID to include OP_ID
>
>HTH
>
>Michael Corrigan
>Programmer
>Endora Digital Solutions
>www.endoradigital.com
>630/942-5211 x-134
>  ----- Original Message -----
>  From: Gonzo Rock
>  To: CF-Talk
>  Sent: Thursday, December 20, 2001 12:52 PM
>  Subject: SQL Question
>
>
>  Given 3 tables:
>
>  Table Operations(Op)
>  Op_ID, Op_Name,...
>
>  and
>
>  Table TravelerHEADER(TravH)
>  TravH_ID, TravName, Part_ID,...
>
>  and
>
>  Table TravelerDetail(TravD)
>  TravD_ID, Op_ID, TravOrder,...
>
>  How can I retrieve the OP RecordSet
>  associated with the subset of TravD records
>  given a single TravH_ID
>
>  IE: For every singular TravH header record there are multiple TravD
>detail records, each of which is related to a singular OP record. I wa
nt
>the OP RecordSet represented by the travD RecordSet.
>
>  I've been trying to do this in a single query statement... do I soun
d
>way new ;) ... I am.
>
>  thanks,
>  Gonzo
>
>

______________________________________________________________________
Get Your Own Dedicated Windows 2000 Server
  PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation � $99/Month � Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to