Home >Backend Development >PHP Tutorial >帮忙写条容易的sql
帮忙写条简单的sql
a表 b表 c表 ,a表和b表条件关联gid ,b表和c表关联cid,我要怎么把这3个表联表呀?
条件是gid=20
数据库类型:mysql
------解决方案--------------------
select * from b left join(a,c) on (a.gid=b.gid and c.cid=b.cid) where b.gid=20
select * from a,b,c where a.gid=b.gid and b.cid=c.cid and a,gid=20