2
Situation
Currently I performed a process twice in which it should be processed only once. So my table was populated twice with the same data.
tb_kardex
cd_kardex | cd_item
tb_kardex
| 1 | 45875 |
| 2 | 45876 |
| 3 | 45877 |
| 4 | 45875 |
| 5 | 45876 |
| 6 | 45877 |
Doubt
How to delete only the "second" record of the same item?
Possible duplicate of How to remove duplicate lines efficiently?
– Ricardo
So @Ricardo mysql != postgresql ... not sure if what applies in the other answer, can help this question, I voted to leave open, but maybe someone who understands postgresql can say your opinion :) - I will wait
– Guilherme Nascimento
@Guilhermenascimento I took the test and it didn’t work. Just like in reply
– Guilherme Lautert
@Guilhermelautert, I made a change in my answer, the fiddle he is with example data only, but delete correctly.
– Ricardo