-1

What I want to do is something like a JOIN but not to get a result in this case: I have a table A containing

idx | values

and a table B containing

idx | A_idx | values

Now I want to delete all these rows in A where A.idx is equal to B.A_idx. Any idea how this can be done?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Elmi
  • 5,899
  • 15
  • 72
  • 143

2 Answers2

3
delete from A where A.idx in (select A_idx from B)
PaulProgrammer
  • 16,175
  • 4
  • 39
  • 56
3

Try this

delete from table a
where IDX in (select a_idx from table b) 
PeteFoulkes
  • 111
  • 10