earlier (work demanded my attention). The SQL you provided worked
without error, but my issue is I need all of the records from the Item
table, regardless of if they have a SubCat or not. Any ideas?...
Cutter
Jochem van Dieten wrote:
> Cutter (CF-Talk) wrote:
> >>From: Cutter (CF-Talk) [mailto:[EMAIL PROTECTED]
> >>Sent: Saturday, December 06, 2003 3:29 PM
> >>To: CF-Talk
> >>Subject: SOT: SQL question
> >>
> >> I have four (4) tables. One table holds IDs that reference info in the
> >> other three (3) tables by ID. I am trying to pull the information for an
> >> item, and pull the info specific to that item from the three tables.
> >> What's wrong with this picture?
> >>
> >> select i.intBoutItemID as ID,
> >> c.txtBoutCat as Cat,
> >> s.txtBoutSubCat as SubCat,
> >> d.txtDesignName as Name,
> >> i.blActive as Active
> >> from tblBoutItem i,
> >> tblBoutCat c,
> >> tblBoutSubCat s,
> >> tblBoutDesign d
> >> where c.intBoutCatID = i.intBoutCatID
> >> and s.intBoutSubCatID = i.intBoutSubCatID
> >> and d.intBoutDesignID = i.intBoutDesignID
> >> Order by d.txtDesignName
>
> > Ok, I think I'm starting to get it. My intBoutSubCatID field will
> > sometimes be null because there will not be a value to associate. This
> > appears to be causing my problem, even using the left join. Any
> > suggestions anyone?
>
> SELECT
> i.intBoutItemID AS ID,
> c.txtBoutCat AS Cat,
> s.txtBoutSubCat AS SubCat,
> d.txtDesignName AS Name,
> i.blActive AS Active
> FROM
> tblBoutCat c,
> tblBoutDesign d,
> tblBoutItem i LEFT JOIN tblBoutSubCat s
> ON i.intBoutSubCatID = s.intBoutSubCatID
> WHERE
> c.intBoutCatID = i.intBoutCatID
> AND d.intBoutDesignID = i.intBoutDesignID
> ORDER BY
> d.txtDesignName
>
> Jochem
>
> --
> When you don't want to be surprised by the revolution
> organize one yourself
> - Loesje
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

