Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6062649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:04:34+00:00 2026-05-23T09:04:34+00:00

This conserns two tables: wp_extra_data and wp_posts. wp_extra_data has the fields id, post_id and

  • 0

This conserns two tables: “wp_extra_data” and “wp_posts”. wp_extra_data has the fields “id”, “post_id” and “post_title_md5”. Now I need to figure out how to retrieve duplicates from “post_title_md5” and then *delete from wp_posts where id = wp_extra_data->post_id except for the oldest post_id (aka the one with the lowest ID*

Example:
wp_extra_data may contain:

ID post_id post_title_md5
23 45      322a85c7502dfb2fce5bbd6794c00f81
56 92      322a85c7502dfb2fce5bbd6794c00f81
75 12      322a85c7502dfb2fce5bbd6794c00f81

In which case I’d want the script to “remove from wp_posts where id = 92 and 12”. So in short; how do I efficiently retrieve duplicates from wp_extra_data and then remove all of them except the one with the lowest key(ID). May be worth to note that I do not know what “post_title_md5” will be up front.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:04:35+00:00Added an answer on May 23, 2026 at 9:04 am
    mysql_query("Delete from wp_posts where ID not in
    (select post_id from wp_extra_data where id in(select min(ID)
    from wp_extra_data
    group by post_title_md5))")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a bit of a long shot, but if anyone can figure it
This is starting to vex me. I recently decided to clear out my FTP,
Lets say I'm interacting with a system that has two incrementing counters which depend
I have a table y Which has two columns a and b Entries are:
I currently have a GAME table with two fields user_id, win win = 1
This question concerns memory in Android. My method: I have two activites, A and
I'm a GWT and Java newbie trying to figure out how to create a
This concerns Intellij from 9 to 11. In the IDEA window On the bottom
This concerns iPhoneOS-sdk-3.2 I am having difficulty changing the border color of a grouped
This is kinda oddball, but I was poking around with the GNU assembler today

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.