我正在尝试使用SQL和内部联接
从我的商店中删除对象这就是我所拥有的:
DELETE appointment_object
FROM appointment_table appointment_object
INNER JOIN sales_person_table sales_person_object
ON appointment_object.made_by.personno = sales_person_object.personno
WHERE sales_person_object.personno = 3;
这是我的错误:
Error report -
SQL Error: ORA-00903: invalid table name
00903. 00000 - "invalid table name"
*Cause:
*Action:
但是,所有属性名称和表名都是正确的。
我还在appointment_object
FROM
之间获得了一些语法突出显示错误:
Expected WHERE, PARTITION
有什么想法吗?
答案 0 :(得分:2)
尝试使用exists
或in
:
DELETE
FROM appointment_table
WHERE EXISTS (SELECT 1
FROM sales_person_table sp
WHERE a.made_by.personno = sp.personno AND
sp.personno = 3
);