declarevarchar temp(10)select @temp=z from DB:A where ...if(@temp==1) select * from DB:B where...else if(@temp==2) select * from DB:C where...else if(@temp==3) select * from DB:D where... 这个思路应该是这样的,你自己把代码补充完整,数据类型定好,希望能帮到你