如何在设计视图中进行删除查询

时间:2010-12-25 06:00:12

标签: ms-access

请为我提供正确的SQL,以便从表中删除所有记录" SYSADM_DISCOUNT_PRICE"其中" [SYSADM_DISCOUNT_PRICE]。[PART_ID]"等于" [tblPartsWithBadDefaultPrice]。[PART_ID]" SYSADM_DISCOUNT_PRICE.DISCOUNT_CODE等于" STANDARD"。

非常感谢你们,祝节日快乐!

删除SYSADM_DISCOUNT_PRICE.DISCOUNT_CODE,SYSADM_DISCOUNT_PRICE.PART_ID FROM SYSADM_DISCOUNT_PRICE INNER JOIN tblPartsWithBadDefaultPrice ON SYSADM_DISCOUNT_PRICE.PART_ID = tblPartsWithBadDefaultPrice.PART_ID WHERE(((SYSADM_DISCOUNT_PRICE.DISCOUNT_CODE)=" STANDARD")AND((SYSADM_DISCOUNT_PRICE.PART_ID)= [tblPartsWithBadDefaultPrice]。[PART_ID]));

1 个答案:

答案 0 :(得分:0)

不了解“MS Access Design View”,但这是您需要的SQL:

DELETE FROM 
  SYSADM_DISCOUNT_PRICE
WHERE 
  PART_ID IN (SELECT PART_ID FROM tblPartsWithBadDefaultPrice) AND
  DISCOUNT_CODE = "STANDARD"