表A(key,v1),表B(key,v2),其中连接的公共字段key。假设A为左表,在MySQL语言中能实现如图涂色部分查询的是( )
key is null是右反连接。key is null是左反连接,
A.select * from A full join B using(key);
B.select * from A left join B using(key)union select * from B right join B using(key);
C.select * from A left join B on A.key=B.key where B.key is null union select * from A right join B on A.key=B.key where A.key is null;
D.select * from A left join B using(key)union all select * from B right join B using(key);
参考答案: C
解析:先查出左反连接和右反连接,再对两张宽表进行纵向连接。select * from A left join B on A.key=B.key where B.key is null是左反连接,select * from A right join B on A.key=B.key where A.key is null是右反连接。