| In general, you can't write a single SQL query that uses multiple databases. You can however write queries that use multiple tables. You haven't written why you need run the query across two databases or why those tables are in separate databases when they are going to be used together, so I'll leave that for another time and answer your question... There are two relatively simple ways to handle this, each with its own benefits and trade offs. You can copy the table of DB2 to DB1, and then run the query (excellent performance on the query, takes little time to migrate data for each execution, but no real change in execution time as data grows), or you can write two queries and merge them in Witango (quick performance on queries, quick and easy to get going, performance slows drastically as data grows beyond a couple of thousand rows due to repetition of queries). For the SQL query you could use something like: SELECT t1.name t1.category t1.detail count(t2.iddest) as 'Count' FROM db1.table1 t1, db1.table2 t2 WHERE t1.category = "A" AND t1.id = t2.iddest For the Witango you could: 1/ Query Table 1 for all category A records and assign to table_1_results 2/ execute an <@rows> loop for each row in table_1_results and query table 2 for a count of records where iddest equals the id of the current row Regards, Jason. On 20/07/2005, at 5:00 AM, Isabelle wrote:
WITH IMAGINATION Planning, Implementation and Management of Web Applications 160 Pacific Highway North Sydney NSW Australia 2060 phone + 612 9929 9229 fax + 612 9460 4770 web - www.wi.com.au email - [EMAIL PROTECTED] ________________________________________________________________________ TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf |
