我不知道为什么我在 MySql 中完全加入时会收到此错误
I don't know why I'm getting this error in full join in MySql
select w.fname,w.salary, t.worker_title 来自 Worker w full join Title t on w.worker_id=t.worker_ref_id;
错误 1064 (42000):您的 SQL 语法有误;查看与您的 MySQL 服务器版本对应的手册,了解在第 1
行 'full join Title t on w.worker_id=t.worker_ref_id' 附近使用的正确语法
老兄试试 worker as w INNER JOIN title as t
如果你想要完整的 ouret join 结果,请使用以下方式:
SELECT p.LastName, p.FirstName, o.OrderNo
FROM persons AS p
LEFT JOIN
orders AS o
ON o.orderNo = p.p_id
UNION ALL
SELECT NULL, NULL, orderNo
FROM orders
WHERE orderNo NOT IN
(
SELECT p_id
FROM persons
)
select w.fname,w.salary, t.worker_title 来自 Worker w full join Title t on w.worker_id=t.worker_ref_id; 错误 1064 (42000):您的 SQL 语法有误;查看与您的 MySQL 服务器版本对应的手册,了解在第 1
行 'full join Title t on w.worker_id=t.worker_ref_id' 附近使用的正确语法老兄试试 worker as w INNER JOIN title as t
如果你想要完整的 ouret join 结果,请使用以下方式:
SELECT p.LastName, p.FirstName, o.OrderNo
FROM persons AS p
LEFT JOIN
orders AS o
ON o.orderNo = p.p_id
UNION ALL
SELECT NULL, NULL, orderNo
FROM orders
WHERE orderNo NOT IN
(
SELECT p_id
FROM persons
)