SELECT CAR.carID, CAR.carname,
   OPTIONS.optname
FROM CAR
   INNER JOIN CAROPTION ON CAR.carID = CAROPTION.carID
   INNER JOIN OPTIONS ON CAROPTION.optID = OPTIONS.optID

That'd return a recordset like this:
1, civic, blue
1, civic, leather
1, civic, alloy
2, accord, red
2, accord, cloth
2, accord, steel

---
Barney Boisvert, Senior Development Engineer
AudienceCentral (formerly PIER System, Inc.)
[EMAIL PROTECTED]
voice : 360.756.8080 x12
fax   : 360.647.5351

www.audiencecentral.com

> -----Original Message-----
> From: Emmet McGovern [mailto:[EMAIL PROTECTED]
> Sent: Thursday, June 12, 2003 2:05 PM
> To: CF-Talk
> Subject: RE: paired values in lists
>
>
> Good point.  I still don't understand how I would write the code though
> to pair up the option to the attribute.  Some times I just can't seem to
> get over the learning hurdle.  I think age is taking its toll. :)
>
> -----Original Message-----
> From: Barney Boisvert [mailto:[EMAIL PROTECTED]
> Sent: Thursday, June 12, 2003 5:15 PM
> To: CF-Talk
> Subject: RE: paired values in lists
>
> You probably want to create a CAROPTION table to replace the attributes
> column in CAR:
>
> carID | optID | attID
> 1 | 1 | 2
> 1 | 2 | 4
> 1 | 3 | 5
> 2 | 1 | 1
> 2 | 2 | 3
> 2 | 3 | 6
>
> It adds a join, and splits the data, but will make searching enormously
> easier.
>
> ---
> Barney Boisvert, Senior Development Engineer
> AudienceCentral (formerly PIER System, Inc.)
> [EMAIL PROTECTED]
> voice : 360.756.8080 x12
> fax   : 360.647.5351
>
> www.audiencecentral.com
>
> > -----Original Message-----
> > From: Emmet McGovern [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, June 12, 2003 1:47 PM
> > To: CF-Talk
> > Subject: paired values in lists
> >
> >
> > I posted a question earlier with a horrible explanation so here is my
> > second try.  I'm making a car database where you can add as many
> > attributes with as many options for each attribute.  I'm guessing you
> > need to put the options/attributes as pairs in the attribute column in
> > the car table.  How would I loop through that table switching the
> > delimiter to display the car and its attributes properly?  As a bonus,
> > how would I search for a car based on the attribute options?
> >
> > The app should work like so.
> >
> > There needs to be an attribute manager.  Each attribute would be able
> to
> > have its own options. such as.
> >
> > TBL ATTRIBUTES
> > --------------------------------------------
> > attID | attname |
> > --------------------------------------------
> > 1 | color
> > 2 | interior
> > 3 | wheels
> >
> >
> > TBL OPTIONS
> > --------------------------------------------
> > optID | attID | optname |
> > --------------------------------------------
> > 1 | 1 | red
> > 2 | 1 | blue
> > 3 | 2 | cloth
> > 4 | 2 | leather
> > 5 | 3 | alloy
> > 6 | 3 | steel
> >
> > That part is simple enough.  My problem is how to handle the data in
> the
> > car table.  I'm assuming I would use paired values in a list, although
> > im not quite sure how to loop through it.
> >
> > TBL CAR
> > --------------------------------------------
> > carID | carname | attributes
> > --------------------------------------------
> > 1 | civic | 1^2;2^4;3^5
> > 2 | accord | 1^1;2^3;3^6
> >
> > (ie blue civic with leather interior and steel wheels)
> >
> > Any help is appreciated.
> >
> >
> > Emmet
> >
>
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Host with the leader in ColdFusion hosting. 
Voted #1 ColdFusion host by CF Developers. 
Offering shared and dedicated hosting options. 
www.cfxhosting.com/default.cfm?redirect=10481

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to