此命令有什么问题,
select * from quote
where
supplier_name = supplier.supplier_name;
我不断收到错误消息(无效的标识符)
答案 0 :(得分:1)
错误:您正在尝试使用未选择的表中的值。
解决方案:有两种方法:
使用子查询
SELECT * FROM QUOTE
WHERE
QUOTE.SUPPLIER_NAME =
(SELECT SUPPLIER.SUPPLIER_NAME FROM SUPPLIER
WHERE
SUPPLIER.SUPPLIER_NAME = QUOTE.SUPPLIER_NAME
);
使用加入:
SELECT QUOTE.* FROM QUOTE
JOIN SUPPLIER
ON QUOTE.SUPPLIER_NAME = SUPPLIER.SUPPLIER_NAME