大家好,这是我的架构:http ://sqlfiddle.com/#!4/82771
CREATE TABLE t1
(
Age INT,
Name VARCHAR(20)
);
CREATE TABLE t2
(
Age INT,
Name VARCHAR(20)
);
INSERT INTO t1(Age, Name) VALUES(31, NULL);
INSERT INTO t1(Age, Name) VALUES(32, NULL);
INSERT INTO t1(Age, Name) VALUES(33, NULL);
INSERT INTO t1(Age, Name) VALUES(34, NULL);
INSERT INTO t2(Age, Name) VALUES(31, 'Panos');
我需要一个 Join 查询,它会给我这个结果:
Age Name
31 'Panos'
32 Null
33 Null
34 Null
我已经在 Age 上尝试了 LEFT JOIN 和 RIGHT JOIN,但我无法得到我需要的东西。它应该很简单,但它只是不来找我......