Actually it is a one to one relationship.
There is only one set of tables per company name.

-----Original Message-----
From: John [mailto:[EMAIL PROTECTED]]
Sent: 15 May 2001 17:38
To: CF-Talk
Subject: RE: SQL Joins.


I am guessing this is a one to many relationship between company_table and
the remaining tables.

select * from
company_table t1 left outer join
slow_stream t2 t1.name = t2.name left outer join
medium_stream t2 on t1.name = t3.name  left outer join
fast_stream t4 on t1.name = t4.name

However, you may encounter problems joining on text fields if the data type
is char and not varchar or if the values have not been trimmed.  In that
case you would need to either add company_id to each of the tables or trim
the name filed in the on statement.

Hope this helps

John


-----Original Message-----
From: Darren Adams [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 15, 2001 11:09 AM
To: CF-Talk
Subject: SQL Joins.


Hello folks,

I ma having a spot of bother with joining tables in a query and could do
with some advice.

There are 4 tables:  company_table, slow_stream, medium_stream and
fast_stream

Company table holds: company ID, name.

The other tables also have a company_name field.

I want to join all the tables together on the name field to give me one
virtual table.

What is the best way to go about this,  I have tried in a number of ways.

Darren Adams
Web Developer
Marketing Department
Systems Union

Office: 01252 55 6220
Mobile: 07714 817 038
Email: [EMAIL PROTECTED]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to