mysql - How to deleterows from one table depending on values from other table -
table i.
columns : b c d values: b c d q w e r
table ii
c: b c d e v: b c d e
on both tables a, b ,c ,d define 1 row (primary key).
now need delete rows table when in table ii e=e (obviously mapping betwwen 2 tables on a, b, c ,d).
i need perform in 1 query only. please.
i tried : delete table (a,b,c,d) in(select a,b,c,d table ii e='e')
is correct??
you can join both tables in delete
statements, eg.
delete table1 inner join table2 b on a.a = b.a , a.b = b.b , a.c = b.c , a.d = b.d b.e = 'e'
Comments
Post a Comment