Sunday, October 3, 2010

SELF JOIN to delete from the same table

DELETE o FROM users u, uc_orders AS o JOIN uc_orders AS o1 ON o.order_id = o1.order_id
WHERE o1.uid = u.uid AND (u.mail like 'test%);

No comments:

Post a Comment