Mysql – delete with joining the same table

MySQL

is it posssible to execute a delete query statement that joins the same table,
i've tried various joins (inner, left) but no luck mysql returns error

example of what i need:

DELETE `a` FROM `t1` AS `a`
INNER JOIN `t1` AS `b` USING `some_field_b`
WHERE 
    `a`.`some_field_a` = 'value_x' AND 
    `b`.`some_field_a` = 'value_y'

Best Answer

Although the manual seems to suggest the INNER JOIN syntax should work in a DELETE, I know that this alternative with the join clause moved to the where condition would work....

DELETE  a.* FROM t1 AS a, t1 as b 
WHERE 
    a.some_field_b=b.some_field_b AND
    a.some_field_a = value_x AND 
    b.some_field_a = value_y

Edit: I just tried this, which worked for me:

DELETE a FROM t1 AS a 
INNER JOIN t1 as b USING(some_field_b) 
WHERE 
    a.some_field_a = value_x AND 
    b.some_field_a = value_y