How to update a field with some value of that record

If you want to update a field with some value of that record with sql query.

update test u
inner join test temp on
    u.id = temp.id
set u.second_name = temp.first_name

Before updating the data
tb_b

After updating the data
tb_a

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s