DELETE dbo.bBoxDetail
FROM dbo.bBoxDetail AS BD
INNER JOIN dbo.bBoxHeader AS BH ON LTRIM(RTRIM(BD.bBoxDetailId)) = LTRIM(RTRIM(BH.bBoxId))
WHERE LTRIM(RTRIM(BD.ESNs)) = (SELECT LTRIM(RTRIM(IMEI)) FROM dbo.tmpIMEI)
我收到此错误:
消息 512,级别 16,状态 1,第 1 行子查询返回超过 1 个值。当子查询跟随 =、!=、<、<=、>、>= 或子查询用作表达式时,这是不允许的。
BD.ESNs
isNVARCHAR(50)
和IMEI
isNVARCHAR(30)
我有重复ESNs
的,我想删除所有ESNs
匹配的SELECT ... IMEI