新聞中心
如果需要實(shí)現(xiàn)MySQL多表聯(lián)查,用什么方法可以實(shí)現(xiàn)呢?下面就為您介紹兩種常見的實(shí)現(xiàn)MySQL多表聯(lián)查的方法,希望對您有所啟迪。

十年的薩迦網(wǎng)站建設(shè)經(jīng)驗(yàn),針對設(shè)計(jì)、前端、開發(fā)、售后、文案、推廣等六對一服務(wù),響應(yīng)快,48小時(shí)及時(shí)工作處理。成都營銷網(wǎng)站建設(shè)的優(yōu)勢是能夠根據(jù)用戶設(shè)備顯示端的尺寸不同,自動(dòng)調(diào)整薩迦建站的顯示方式,使網(wǎng)站能夠適用不同顯示終端,在瀏覽器中調(diào)整網(wǎng)站的寬度,無論在任何一種瀏覽器上瀏覽網(wǎng)站,都能展現(xiàn)優(yōu)雅布局與設(shè)計(jì),從而大程度地提升瀏覽體驗(yàn)。創(chuàng)新互聯(lián)從事“薩迦網(wǎng)站設(shè)計(jì)”,“薩迦網(wǎng)站推廣”以來,每個(gè)客戶項(xiàng)目都認(rèn)真落實(shí)執(zhí)行。
MySQL多表聯(lián)查例子:
下面這兩個(gè)MySQL多表聯(lián)查方法都可以,inner join on 更好點(diǎn)。表結(jié)構(gòu)沒貼出來,但比較好懂了。
MySQL多表聯(lián)查的簡單方法:
- select c.nom, e.nom
- from consultant c, affaire a, besoin b, salarie sa, site s, entreprise e
- where c.consultant_id=a.consultant_id and a.besoin_id=b.besoin_id and
- b.salarie_id=sa.salarie_id and ssa.site_id=s.site_id and s.entreprise_id=e.entreprise_id
MySQL多表聯(lián)查的inner join方法:
- select c.nom, e.nom
- from consultant c
- inner join affaire a on c.consultant_id=a.consultant_id
- inner join besoin b on a.besoin_id=b.besoin_id
- inner join salarie sa on b.salarie_id=sa.salarie_id
- inner join site s on ssa.site_id=s.site_id
- inner join entreprise e on s.entreprise_id=e.entreprise_id
【編輯推薦】
帶您了解mysql變量
撤權(quán)并刪除MySQL用戶的方法
使用MySQL命令行備份及恢復(fù)數(shù)據(jù)庫
MySQL root用戶密碼忘記的處理方法
MySQL創(chuàng)建函數(shù)問題的處理方法
新聞名稱:兩種實(shí)現(xiàn)MySQL多表聯(lián)查的方法
網(wǎng)址分享:http://m.fisionsoft.com.cn/article/cccgihp.html


咨詢
建站咨詢
