Select Query on 2 tables, on different database servers

前端 未结 3 2032
一个人的身影
一个人的身影 2021-01-06 05:34

I am trying to generate a report by querying 2 databases (Sybase) in classic ASP.

I have created 2 connection strings:

connA for databaseA

3条回答
  •  臣服心动
    2021-01-06 06:07

    temp is out of scope in q2.

    All your work can be done in one query:

    
    SELECT a.columnA, a.columnB,..., a.columnZ
    FROM table2 a
    INNER JOIN (SELECT databaseA..table1.column1 
                FROM databaseA..table1
                WHERE databaseA..table1.xyz = 'A') b
      ON a.columnB = b.column1
    

提交回复
热议问题