mysql - You can't specify target table 'NAME' for update in FROM clause -


im trying apply this solution data in table in mysql db has duplicates. , such error:

sql error [1093] [hy000]: can't specify target table 'name' update in clause   delete name name name.id not in    (select min(id)     name group col1, col2) 

also tried assign aliases - without success. reason of error here? points sql script can produce cyclic process, here dont see relevant - obvious 2 selections delete , select detached - engine must select once firstly , use in where conditions delete. - why error happens , how can deduplicate table? =)

try may you

delete  name name.id not in (                      select * (                                      select min(id)  name group col1,col2                                    ) p                        )  

read more


Comments