跨库查询的问题 有两个库A,B库A下面有表a,有字段id,value库B下面有表b,有字段id,type其中表a与表b中的id是相同的现在想统计表a中,value为1并且id在表b中type为1的数量这个跨库查询语句该怎么写? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 假设在同1服务器中select * from a.a a1 inner join b.b b1 on a1.id=b1.idwhere a1.value=1 and b1.type=1 如不在同1服务器中,建立FEDERATED引擎表,再用上述代码 select count(*)from A.a T1,B.b T2where T1.id=T2.id and T1.value=1 and T2.type=1 假设在同1服务器中 select count(*) from a.a a1 inner join b.b b1 on a1.id=b1.id where a1.value=1 and b1.type=1 用触发器同步跟新两个表的一个字段数据,遇到怪问题! 取到一个字段替换当前列的另一个字段 求问workbench怎么导出frm文件啊~ 高手给看看这是什么原因啊 mysql中文乱码??(mysql+php)在线等,急 mysql 在win xp 如何用命令重启服务。 mysql监控软件 Mysql 中的数据库删除出错问题? mysql错误问题,在线等 高分 求一sql语句! c++连接mysql的问题 绑定不了自己的数据,各位帮忙看看
select * from a.a a1 inner join b.b b1 on a1.id=b1.id
where a1.value=1 and b1.type=1
from A.a T1,B.b T2
where T1.id=T2.id and T1.value=1 and T2.type=1
select count(*) from a.a a1 inner join b.b b1 on a1.id=b1.id
where a1.value=1 and b1.type=1