We help IT Professionals succeed at work.
Get Started

MySQL server database query

toooki
toooki asked
on
323 Views
Last Modified: 2012-05-11
I have two database tables TAB1 TAB2 both in MYSQL server database.
Both tables have identical field names and data types as below:

F1  SMALLINT
F2  TIMESTAMP
F3  CHAR
F4  VARCHAR
F5  INT
F6  INT
F7  INT
F8  VARCHAR

I need to UPDATE all the values of F2 field (TIMESTAMP values) in TAB2 with the
correct values of F2 field in TAB1 (where rest of the record contents match in both tables).

There are NO primary keys in the tables.
TAB2 has ~800K records and TAB1 has ~900K records.
All the entries (with incorrect F1 field values) in TAB1
should ideally be in the TAB2 table.

What should be the best way to make this update?
Performance of the update query seems to be a big problem.
Comment
Watch Question
Director, SD-WAN Solutions
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 1 Answer and 13 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE