用关联查询也可以啊 select * from Atable left join Btable where Atable.A = Btable.ID
再精确点的 select * from Atable left join Btable on Atable.A = Btable.ID where Atable.A = 1
加入我Atable里有个字段和CTable里面的字段ID关联,我可以像下面这样写吗? select * from Atable left join Btable on Atable.A = Btable.ID left join Ctable on Atable.B = Ctable.ID where Atable.A = 1 and Atable.B = 3
B表:id s2
2表id连接,根据A表的ID值,查询B表内容select B.* from A, B where A.id=B.id and A.id=1
加入我Atable里有个字段和CTable里面的字段ID关联,我可以像下面这样写吗?
select * from Atable left join Btable on Atable.A = Btable.ID left join Ctable on Atable.B = Ctable.ID where Atable.A = 1 and Atable.B = 3