sharing-jdbc分片库与默认库可以jion吗

mdjs 发布于 2019/03/28 11:37
阅读 638
收藏 2
sql = select count(*) from t_device_info d join t_energy_hourdata e on d.id=e.deviceId where e.prj in (1,2) and e.sharingFlag='2018-03' limit 100

### Cause: com.dangdang.ddframe.rdb.sharding.exception.ShardingJdbcException: com.dangdang.ddframe.rdb.sharding.exception.ShardingJdbcException: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'energydata.t_device_info' doesn't exist] with root cause
 

其中t_device_info表在默认库,t_energy_hourdata在分片库。然后报错了

如果带上sql = select count(*) from energymgr.t_device_info d join energydata.t_energy_hourdata e on d.id=e.deviceId where e.prj in (1,2) and e.sharingFlag='2018-03' limit 100

报不支持energydata.table错

 

 

 

加载中
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部