This question has already been answered:

You need to make a request to the database in which there are many records of matches. For example, according to the parameters id_cabinet = '1' and id_staff = '1' are up to 10 identical ones, how can you leave only one and remove the redundant ones?

Reported as a duplicate by members of Pavel Mayorov , Community Spirit 19 Apr '16 at 13:30 .

A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .

  • And immediately the question: which one to leave? First? Last one? Average? - dlarchikov
  • one
    Perhaps a duplicate question: ru.stackoverflow.com/questions/193369/… - Evgeny Borisov
  • Is there an id in the tablet? - jekaby

1 answer 1

 DELETE t1 FROM my_table t1, my_table t2 WHERE t1.id > t2.id AND t1.id_cabinet = t2.id_cabinet AND t1.id_staff = t2.id_staff;