How to delete in MS Access when using JOIN's?

后端 未结 3 1470
渐次进展
渐次进展 2020-12-01 05:24

I am attempting to use the DELETE clause in MS Access and have an issue when also using the JOIN clause. I have notice this can be accomplished by

3条回答
  •  隐瞒了意图╮
    2020-12-01 05:53

    One problem to be aware of: This does NOT work with table/query aliases!

    DELETE a.*
    from tblA as A
    where exists (select 1 from tblB as B where a.id=b.id)
    

    Deletes ALL records in tblA! I tried it using alias for tblA and tblB seperately - same result (Access 2010).

    Happens with SELECT as well (which I often use before deleting)...

提交回复
热议问题