19

Is there a way I can duplicate a column's values into another column?

IE:

s_id  img_id
1     -
2     -
3     -
4     -

to

s_id  img_id
1     1
2     2
3     3
4     4

1 Answer 1

40
UPDATE your_table SET img_id = s_id;
Sign up to request clarification or add additional context in comments.

2 Comments

Worked perfect. Can't believe I didn't think of it... >_<
is this ok for wordpress wp_usermeta tables, i have a column to that i need to copy

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.