0

I have following table enter image description here

I am trying if I have new record with same email id. I want to update previous records with that emailId in single query.

I don't want to update record with i have duplicate record. I am using insert ignore for that.

Any help?

Donald Duck
  • 8,409
  • 22
  • 75
  • 99
arun kamboj
  • 1,145
  • 4
  • 17
  • 48

1 Answers1

-1

make email-id as a primary key and use the following Query

INSERT INTO table_name
VALUES
    ('id', 'email', 'val1', 'val2') ON DUPLICATE KEY UPDATE 'something

'

Faisal
  • 4,591
  • 3
  • 40
  • 49
Pavankant
  • 212
  • 1
  • 12