App下載
話題 首頁 > MySQL 教程 > MySQL 教程話題列表 > 詳情

mysql 如何實現多表跨庫聯合查詢?

精華
測試波 2016-10-09 02:21:58 瀏覽(34769) 回復(5) 贊(0)
現有兩張表,user在ucenter庫中;user_profile在database庫中。user和user_profile通過uid字段關聯。 請問通過mybatis如何實現跨庫聯合查詢?
mysql

回答(5)

2016-10-09
    select 
        a.uid  
    from 
       ucenter.user a , database user_profile b 
   where a.uid = b.uid;

其實直接在需要查詢的表上加上庫名就可以直接使用。

741467875 2017-06-14

select a.uid

from ucenter. user.a,from database. user_profile.b

where a.uid=b.uid;

一筆荒蕪 2018-05-31

這個領域不太懂!! 還是坐等大佬吧...

1144100656 2018-05-31

留名留名!!!,同樣的問題,看看咋結局!!!

1152696398 2018-05-31

好慢呀,空空如也,半天不來大神解決,大佬在哪啦

要回復,請先登錄 或者注冊