A. sql语句如何实现一张表的两个字段通过外连接另一张表得到想要的信息
基本这样:
select*frommsginfoa,userinfob,userinfocwherea.msgsenderid=b.useridanda.msgreceiverid=c.userid
*你替换成要查询的相应前缀+字段即可。
就是userinfo表用两次,分别关联msginfo表的两个字段。
B. sql怎么两个表关联
select B.c,e,f from A left join B on A.c=B.c
这样就可以了
C. sql语句:一个表和另外两个表的关联语句
select * from a inner join b on a.bid=b.id inner jion c on a.cid=c.id
select * from a,b,c where a.bid=b.id and a.cid=c.id
D. 怎么用SQL取一张表关联另一张表
你表达的意思不是很明白啊,,,,,
你是要这样?
selecta.id,b.*
fromaleftjoinbona.id=b.id