我想在SQL Server 2008中使用删除。INNER JOIN
INNER JOIN
但我得到这个错误:
消息 156,级别 15,状态 1,第 15 行关键字“INNER”附近的语法 不正确。
我的代码:
DELETE FROM WorkRecord2 INNER JOIN Employee ON EmployeeRun=EmployeeNo WHERE Company = '1' AND Date = '2013-05-06'
您需要指定要从哪个表中删除。这是一个带有别名的版本:
DELETE w FROM WorkRecord2 w INNER JOIN Employee e ON EmployeeRun=EmployeeNo WHERE Company = '1' AND Date = '2013-05-06'