On 4/30/00, Chris Giminez penned:
>Sorry if this is a lame question. I'm not very strong in SQL yet and
>am having a brain freeze on how
>to do this.
>
>I have table A where I pull one record. In this one record are name
>ID's that correspond to table B
>where the name ID's are associated with full name, email, phone, etc.
>
>How do I post information of each name id from table A as the full
>name, email, phone, etc from
>table B
<CFQUERY DATASOURCE="mydatasource" NAME="myQuery">
SELECT Name,Address,City,State,Etc
FROM Table_A,Table_B
WHERE Table_A.NameID = Table_B.NameID AND
Some_Record_From_Table_A = '#Some_Search_Criteria#'
</CFQUERY>
Name, Address, City and State are from table b. You could also
include any records you like from table a. The only time you'll need
to specify the table (like in Table_A.NameID) is if there are fields
named the same in both tables. It's also very important NOT to name
fields the same in two tables that may be called from the same query
unless they ARE related and contain the same info.
Then:
<cfoutput query = "myQuery">
#Name#<br>
#Address#<br>
#City#<br>
#State#<P>
</cfoutput>
Bud Schneehagen - Tropical Web Creations
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
ColdFusion Solutions / eCommerce Development
[EMAIL PROTECTED]
http://www.twcreations.com/
954.721.3452
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
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.