简体   繁体   中英

Multiple Table Join For Search Query PHP & Mysql

I'm still facing problem with multiple table joining in MySQL. I want to make a search with multiple tables, here I have 8 tables & I want to join all tables together to get all values from 8 tables while searching my site. Please help me to solve this problem. Thanks in advance. [NB: All Table Formats Are Similar

select *
from A
join B
on A.c1 = B.c2
join C 
on B.c3 = C.c4
join D
on C.c5 = D.c6
join E
on D.c7 = E.c8
join F
on E.c9 = F.c10
join G
on F.c11 = G.c12
join H
on G.c13 = H.c14

Replace large letters with your tables and ci with the corresponding column. Join criteria can be virtually anything, for simplicity's sake I have chosen equality of columns

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM