Make sure you use distinct or in() for those subqueries. If you're
returning more than 1 employer_id or family_id then that'll cause an
error too.

On 3/31/06, Matt Williams <[EMAIL PROTECTED]> wrote:
> What error are you getting? Or is it just bad data?
>
> If your Client_ID fields are numeric, then you shouldn't have quote marks
> around them.
>
> I usually do inner joins as follows...
>
> Select C.*, FG.*, E.*
> from clients C
>   inner join family_groups FG on C.Family_ID = FG.Family_ID
>   inner join employers E on C.Employer_ID = E.Employer_ID
> where C.Family_ID =
>                         ( Select Family_ID
>                         from clients
>                        where Client_ID = '#Session.Client_ID#')
>                          and C.Employer_ID =
>                              ( Select Employer_ID
>                                  from clients
>                                 where Client_ID = '#Session.Client_ID#')
>
> On 3/31/06, Rick Faircloth <[EMAIL PROTECTED]> wrote:
> >
> > Hi, all...
> >
> > I've been wrestling with what should be a simple problem
> > for too many hours...I've got to break things down and
> > re-evaluate.  Thought some more eyes might help.
> >
> > Anything inherently wrong with this?
> >
> > Rick
> >
> >           <CFQUERY Name="Get_Client" Datasource="#DSN#">
> >
> >                Select C.*, FG.*, E.*
> >                    from clients C
> >            inner join family_groups FG, employers E
> >                    on C.Family_ID = FG.Family_ID
> >                   and C.Employer_ID = E.Employer_ID
> >                 where C.Family_ID =
> >                          ( Select Family_ID
> >                          from clients
> >                         where Client_ID = '#Session.Client_ID#')
> >                           and C.Employer_ID =
> >                               ( Select Employer_ID
> >                                   from clients
> >                                  where Client_ID = '#Session.Client_ID#')
> >
> >           </CFQUERY>
> >
> >
> >
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:236711
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to