实际情况是这样,我有可能同时要对几台数据库进行数据操作,因为这些数据库有一个表的结构是一样的,所以我要用UNION ALL进行查讯,
下面是在同一台server上的select语句,想问问怎样连不同台server的数据。select A.aa,A.bb from PK1.A
union all
select A.aa,A.bb from PK2.A
union all
select A.aa,A.bb from PK3.A
select A.aa,A.bb from PK1.A
union all
select A.aa,A.bb from PK2.A
union all
select A.aa,A.bb from PK3.A
union all
select A.aa,A.bb from ??PK1.A
union all
select A.aa,A.bb from ??PK2.A
union all
select A.aa,A.bb from ??PK3.A
下面是在同一台server上的select语句,想问问怎样连不同台server的数据。select A.aa,A.bb from PK1.A
union all
select A.aa,A.bb from PK2.A
union all
select A.aa,A.bb from PK3.A
select A.aa,A.bb from PK1.A
union all
select A.aa,A.bb from PK2.A
union all
select A.aa,A.bb from PK3.A
union all
select A.aa,A.bb from ??PK1.A
union all
select A.aa,A.bb from ??PK2.A
union all
select A.aa,A.bb from ??PK3.A
union all
select A.aa,A.bb from a@pk2
union all
select A.aa,A.bb from a@pk3
dblink 以及对用户对这些表授权
一条SQL怎么同时交互多个server
我觉得你只能分别取,再用程序去做 C#什么的
--对不同的server分别建dblinkselect A.aa,A.bb from a@pk1
union all
select A.aa,A.bb from a@pk2
union all
select A.aa,A.bb from a@pk3