文章詳情頁(yè)
spring - mysql 如何實(shí)現(xiàn)多表跨庫(kù)聯(lián)合查詢?
瀏覽:199日期:2022-06-17 18:49:22
問題描述
問題解答
回答1:我的項(xiàng)目中也有很多跨庫(kù) 表關(guān)聯(lián)的查詢,實(shí)現(xiàn)起來(lái)很簡(jiǎn)單:
select a.uid fromucenter.user a , database user_profile b where a.uid = b.uid;
只要在表的前邊加上庫(kù)名即可。
這個(gè)是我項(xiàng)目中xml 中的一個(gè)例子,項(xiàng)目采用的是springmvc,持久層框架就是mybatis:

項(xiàng)目的數(shù)據(jù)源配置:
上一條:mysql 索引查詢問題下一條:mysql 欄位值移動(dòng)
相關(guān)文章:
1. boot2docker無(wú)法啟動(dòng)2. docker-compose中volumes的問題3. 關(guān)docker hub上有些鏡像的tag被標(biāo)記““This image has vulnerabilities””4. nignx - docker內(nèi)nginx 80端口被占用5. docker安裝后出現(xiàn)Cannot connect to the Docker daemon.6. javascript - mock.js可以存儲(chǔ)數(shù)據(jù)嗎7. java - SSH框架中寫分頁(yè)時(shí)service層中不能注入分頁(yè)類8. golang - 用IDE看docker源碼時(shí)的小問題9. docker api 開發(fā)的端口怎么獲取?10. dockerfile - 為什么docker容器啟動(dòng)不了?
排行榜

熱門標(biāo)簽
網(wǎng)公網(wǎng)安備