That depends. If for example the datasources point to two different
databases on the same server for which the login for the datasource used
in the cfquery tag has access to both it is trivial. Or if they are on
two different servers joined by a linked server and the user has access
to both.


Example

Database a on server 1
Database b on server 2    
both allow login by user bob
There is a link set up on the data base server between the two or they
are on the same server

Datasource x points to database a
Datasource y points to database b


<cfquery name="REQUEST.qSelectFromAandB" datasource="x">
        
        SELECT  table1.firstcolumn,
                        table2.firstcolumn
        FROM    
                        a.dbo.table1
                        AS table1
                        INNER JOIN b.dbo.table2
                                AS table2
                                ON table2.table1ID = table1.table1ID

</cfquery>


IF there is no link on the database between the two you can query the
relevant data from each in separate queries and use a query of queries
to join them.

-----Original Message-----
From: Charles Love [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 17, 2007 1:26 PM
To: CF-Talk
Subject: Multiple data sources in one query?

Does anyone know if there is a way to access data from multiple data
sources in one query or joined query? 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Check out the new features and enhancements in the
latest product release - download the "What's New PDF" now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:286502
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to