0

How to insert and update in one query from temp table. I have finaltable in which primary keys are Callid and segment

INSERT INTO `finaltable` (select * from tempdb.Matched);
Sanya Zahid
  • 466
  • 6
  • 18
  • are you trying to insert a new `row` and update an old row at the same time? – Sreetam Das Jun 07 '17 at 06:11
  • You cannot insert and update in a single query. There is as insert ... select ... syntax and an insert ... on duplicate key update ... Both have been repeatedly discussed here on SO. Pls provide more details as to what you are trying to achieve here. – Shadow Jun 07 '17 at 06:12
  • yes i am trying to insert a new row and update an old row at the same time – Sanya Zahid Jun 07 '17 at 06:14

0 Answers0