0

I want to update some table rows. I've tried to make a query that updates my table row by selecting some row id's from a select query in this way:

UPDATE `subsequence` SET `tcStart`= `tcStart`+1  WHERE ID_subsequence 
in (select ID_subsequence from subsequence join sequence on subsequence.ID_sequence 
= sequence.ID_sequence WHERE sequence.tcStart = subsequence.tcStart)

When i try to execute it, I have this error message :

#1093 - You can't specify target table 'subsequence' for update in FROM clause 

So any help please !

KubiRoazhon
  • 1,759
  • 3
  • 22
  • 48
  • 1
    Possible duplicate of [MySQL Error 1093 - Can't specify target table for update in FROM clause](http://stackoverflow.com/questions/45494/mysql-error-1093-cant-specify-target-table-for-update-in-from-clause) – Tom H Dec 23 '15 at 19:21
  • Not exactly the same issue – KubiRoazhon Dec 23 '15 at 19:29
  • Well, as it contains this in the answer: "In MySQL, you can't modify the same table which you use in the SELECT part.", it is pretty much exactly the same. – Fuzzzzel Dec 23 '15 at 19:44

0 Answers0