Title: SQL: DELETE using a JOIN
Last modified: August 18, 2016

---

# SQL: DELETE using a JOIN

 *  [kccricket](https://wordpress.org/support/users/kccricket/)
 * (@kccricket)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/sql-delete-using-a-join/)
 * According to one tutorial that I read, the following SQL statement is only valid
   for MySQL 4 and later:
    `DELETE {$table_prefix}postmeta FROM {$table_prefix}postmeta
   JOIN {$table_prefix}posts ON ({$table_prefix}postmeta.post_id={$table_prefix}
   posts.ID) WHERE meta_key='$key' AND meta_value='$value' AND post_author=$user_ID`
 * What would be the most effective way to perform this type of query so that it
   will be compatible with MySQL 3?
 * Thanks.

The topic ‘SQL: DELETE using a JOIN’ is closed to new replies.

## Tags

 * [MySQL](https://wordpress.org/support/topic-tag/mysql/)
 * [sql](https://wordpress.org/support/topic-tag/sql/)

 * In: [Everything else WordPress](https://wordpress.org/support/forum/miscellaneous/)
 * 0 replies
 * 1 participant
 * Last reply from: [kccricket](https://wordpress.org/support/users/kccricket/)
 * Last activity: [20 years, 4 months ago](https://wordpress.org/support/topic/sql-delete-using-a-join/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
