Just off the cuff...

SELECT TableA.A_Text, TableB.B_Text, TableC.B_ID
FROM TableB RIGHT JOIN (TableA LEFT JOIN TableC ON TableA.A_ID =
TableC.A_ID) ON TableB.B_ID = TableC.B_ID
WHERE TableC.B_ID Is Not Null

Grabs everything from TableA and Table B, where something exists in
the linking table for B_ID.

Chad

On 7/10/06, Steve Onnis <[EMAIL PROTECTED]> wrote:
>
> what database platform?
>
> -----Original Message-----
> From: [email protected] [mailto:[EMAIL PROTECTED]
> Behalf Of Andrew Scott
> Sent: Monday, July 10, 2006 11:41 AM
> To: [email protected]
> Subject: [cfaussie] Help with a SQL Query
>
>
>
> Hi All,
>
> I am trying to create a mapping table that will combine data from 2 tables.
>
> Table A has the ID, Table B has another, and Table C will have all Table A
> IDs and Tables B id's that match?
>
> So Table C will look something like this
>
> Table_C.A_ID   |   Table_C.B_ID
> -------------------------------
>     100        |    300
>     100        |    301
>     121        |    330
>     122        |    331
>
> I have this at the moment which isn't working
>
> SELECT     Bookings.BO_ID, BookingItems.BI_ID
> INTO            BookingOptions
> FROM         Bookings CROSS JOIN
>                       BookingItems
>
> Anyone see what it is I am doing wrong?
>
>
> Senior Coldfusion Developer
> Aegeon Pty. Ltd.
> www.aegeon.com.au
> Phone: +613  8676 4223
> Mobile: 0404 998 273
>
>
>
>
>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cfaussie
-~----------~----~----~----~------~----~------~--~---

Reply via email to