0 votes
1 view
in SQL by (22.4k points)

I have two tables, both looking like

id  name  value

===================

1   Joe     22

2   Derk    30

I need to copy the value of value from tableA to tableB based on check name in each table.

Any tips for this UPDATE statement?

1 Answer

0 votes
by (64k points)

You can use the following SQL query if you wish to update table B with the value of value from tableA to tableB based on check name of tables:

UPDATE tableB tB

        INNER JOIN tableA tA

             ON tA.name = tB.name

SET tB.value = tA.value

I recommend his SQL Certification course to learn more such tips and tricks in SQL.

Related questions

0 votes
1 answer
asked Jul 18, 2019 in SQL by Tech4ever (22.4k points)
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...