无法从指定的表中删除 - MS Access(使用LEFT JOIN查询DELETE)

时间:2016-08-25 15:22:27

标签: sql join left-join sql-delete access

当我运行下面的查询时,我收到消息"无法从指定的表中删除"。将DELETE更改为SELECT时工作正常。感谢任何指导

MongoError: Error: corrupt bson message
at .messageHandler (../node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/lib/topologies/server.js:245:29)
at Socket.<anonymous> (../node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/lib/connection/connection.js:181:18)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:177:18)
at Socket.Readable.push (_stream_readable.js:135:10)
at TCP.onread (net.js:542:20)

1 个答案:

答案 0 :(得分:0)

您不能将DELETEDISTINCTROW一起使用,因为错误消息告诉您。相反,您可以使用WHERE EXISTS子句重新编写删除查询:

DELETE everything.*
FROM everything
WHERE EXISTS
(
    SELECT 1
    FROM [YTD Leavers]
    WHERE val([YTD Leavers].[Employee Number]) = val(everything.[lookup_number])
) = TRUE