Anna Riekic
Anna Riekic

Reputation: 738

sql update column 2 with column 1 data

Wordpress has 2 columns in its *wp_posts* table

I want to update/change/replace post_modified values with the values of post_date but haven't a clue how to except knowing I need a sql query.

Upvotes: 0

Views: 4493

Answers (2)

Ovais Khatri
Ovais Khatri

Reputation: 3211

Update wp_posts
set w1.post_modified = w2.post_date
from wp_posts w1, wp_posts w2 
where w1.IdCol = w2.IdCol

Upvotes: 1

Arion
Arion

Reputation: 31239

Maybe something like this:

UPDATE wp_posts
SET post_modified= post_date

Upvotes: 3

Related Questions