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

  • Home
  • SEARCH
  • 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 7637639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:59:32+00:00 2026-05-31T07:59:32+00:00

I have a table (post_order) structured like so: | post_id | term_id | post_type

  • 0

I have a table (post_order) structured like so:

   | post_id | term_id | post_type | taxonomy |
   |    1    |    6    |    post   | category |
   |    2    |    6    |    post   | category |
   |    3    |    6    |    post   | category |

I’d like to copy all of the fields to the same table, but change the term_id (say, for example, 7) so, the table would end up looking like this:

   | post_id | term_id | post_type | taxonomy |
   |    1    |    6    |    post   | category |
   |    2    |    6    |    post   | category |
   |    3    |    6    |    post   | category |
   |    1    |    7    |    post   | category |
   |    2    |    7    |    post   | category |
   |    3    |    7    |    post   | category |

I know I could do something like:

INSERT INTO post_order (post_id, term_id, post_type, taxonomy)
SELECT post_id, term_id, post_type, taxonomy
FROM post_order
WHERE term_id = 6

But this would make an exact duplicate and not change the term_id.

How can I achieve this?

  • 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-31T07:59:34+00:00Added an answer on May 31, 2026 at 7:59 am

    hard code the term_id to 7 in your INSERT statement:

    INSERT INTO post_order (post_id, term_id, post_type, taxonomy)
    SELECT post_id, 7, post_type, taxonomy
    FROM post_order
    WHERE term_id = 6
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table that looks like this: meta_id post_id meta_key meta_value 271 4
Sorry for bad english and bad title! I have the table post id title
I have table posts and posts_votes . In posts_votes I have id and post_id
I have table called posts in my DB. Each post has field called social_network
I have a mysql table which columns are post_id and post_msg. Now I want
I have two tables like this: TABLE user( id CHAR(100) text TEXT ) TABLE
I have a table of horses in a classifieds site. The fields in question
I have a table I'd like to do paging and ordering on and was
Hope this is possible- Have a table like so: Car_ID Brand Model Year ----------------------------------
Let say i have three table (post, wall, photo) post (id, post_uid, post_content, post_timestamp)

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.