【发布时间】:2019-06-16 08:23:08
【问题描述】:
我正在学习 sql,并想创建自己的表来练习。我找到了以下网站:https://sqltest.net/
我创建了两个表来练习连接。 LEFT/RIGHT/INNER 连接与我创建的 sql 语句工作正常,但是当我尝试使用 FULL JOIN 时出现以下错误:
Ouuuu snap '':“字段列表”中的未知列“wizards.colours”
这是我做错了什么还是网站出现故障?
CREATE TABLE wizards
(
colours varchar(255),
numbers int,
symbols varchar(255)
);
INSERT INTO wizards
VALUES ('red','49','£'),
('blue','83','$'),
('blue','72','£'),
('purple','24','%'),
('orange','82','$'),
('white','67',NULL),
('blue','17','%'),
('black','12','%'),
('green','97','&'),
('grey','1','%'),
('red','6','£'),
('red','76','%');
CREATE TABLE warriors
(
colours varchar(255),
numbers int,
symbols varchar(255)
);
INSERT INTO warriors
VALUES ('orange','59','£'),
('purple','2','£'),
('white','11','%'),
('blue','78','%'),
('grey','56','$'),
('red','5','%'),
('orange','92',NULL),
('green','50','$'),
('orange','49',NULL),
('red','1','%');
我的sql语句:
SELECT wizards.colours, warriors.numbers, wizards.numbers
FROM wizards
FULL JOIN warriors ON wizards.colours=warriors.colours
ORDER BY wizards.colours;
【问题讨论】:
-
你是用oracle查询还是mysql查询(mysql不支持FULL JOIN)
标签: mysql sql outer-join