On 9/17/00, W Luke penned:
>Hi,
>
>I'm probably being stupid here but can someone please help me on my query?
>It's displaying the correct results - but more than once:
>
><cfquery name="cats" datasource="localads">
>
> SELECT ID, cat_name, sub_name, sub_id, catid
> FROM categories, sub_categories
> WHERE sub_categories.catid = #url.cid#
>
></cfquery>
Yeah Luke. Jeff's right. Any time you query for results from more
than one table, you have to do some sort of join on all the tables
involved.
WHERE categories.catid = sub_categories.catid and
sub_categories.catid = #url.cid#
If you have 3 tables, same thing.
FROM table1, table2, table3
WHERE table1.id = table2.id and table2.id = table3.id and table3.id = #form.id#
--
Bud Schneehagen - Tropical Web Creations
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
ColdFusion Solutions / eCommerce Development
[EMAIL PROTECTED]
http://www.twcreations.com/
954.721.3452
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.