mysql跨库关联查询

1:使用show engines;查看federated引擎是否等于YES,没有在my.ini文件后面加上federated重启mysql

2:SELECT substring_index(a.account,"_",1) as account,sum(a.price) as price
       FROM wxhd.log_recharge a , xuexie.log_recharge b 
       WHERE a.id=b.id
       GROUP BY substring_index(a.account,"_",1);

猜你喜欢

转载自blog.csdn.net/dengpengquan/article/details/82634610