If you have a single table with fields from other tables you can join
them all fairly simply.  Consider the following four tables:

cars
   carid
   cartypeid
   carcolorid
   carmodelid

carmodel
   carmodelid
   model

carcolor
   carcolorid
   color

cartype
   cartypeid
   type


You can get the data from all the tables with a join: 
(i'm using the older syntax cause it is easier, the letters are
aliases)

select a.carid, b.model, c.color, d.type
from cars a, carmodel b, carcolor c, cartype d
where a.carmodelid = b.carmodelid
and a.carcolorid = c.carmodelid
and a.cartypeid = d.cartypeid
and a.carid = 1111

That will get all the data for one car.

Good Fortune,
Richard Walters,
Webmaster, Davita Laboratory Services
[EMAIL PROTECTED]
(800) 604-5227 x 3525

>>> [EMAIL PROTECTED] 04/18/02 11:14AM >>>
can you give more detail?  from just this amount, it sounds like a join
may be in the making.  are all the tables related via the relationship
table?

christopher olive
cto, vp of web development, vp it security
atnet solutions, inc.
410.931.4092
http://www.atnetsolutions.com 


-----Original Message-----
From: Paul Giesenhagen [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, April 18, 2002 11:00 AM
To: CF-Talk
Subject: Re: UNION vs JOIN


I am combining the results of three tables that are very similar in
their
setup and the fourth table holds all the relationships.

Paul Giesenhagen
QuillDesign
http://www.quilldesign.com 
SiteDirector v2.0 - Commerce Builder


> they do different things, really.  what are you trying to
accomplish?
>
> christopher olive
> cto, vp of web development, vp it security
> atnet solutions, inc.
> 410.931.4092
> http://www.atnetsolutions.com 
>
>
> -----Original Message-----
> From: Paul Giesenhagen [mailto:[EMAIL PROTECTED]] 
> Sent: Thursday, April 18, 2002 10:18 AM
> To: CF-Talk
> Subject: OT: UNION vs JOIN
>
>
> Is there a significant difference in performance using a UNION on
four
> tables versus a JOIN on four tables?
>
> Thanks
>
> Paul Giesenhagen
> QuillDesign
> http://www.quilldesign.com 
> SiteDirector v2.0 - Commerce Builder
>
>
> 


______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to