-1
Good morning guys! I’m not so experienced yet in SQL commands, so I’m looking for gurus here to give me a strength.
Come on, I have a chart where they store deposit vouchers that customers send. We notice that eventually there are entries of repeated values, due to release errors. So I created a key that groups data where it is possible to identify duplicities.
SELECT Keycontrol FROM Bancocliente GROUP BY Keycontrol HAVING COUNT(*) > 1;
The problem is that I have two fields with the same description and if you give an update both will suffer cancellation. To solve the problem, I need the return of this select to be within another select that will bring the largest ID of that result, so I will know that I am excluding the second release of the client.
I need to bring the Code of the same table. To later do an UPDATE using the code.
TABLE FIELDS BANK
Code
Keychain
Do your repeated control keys refer to the same customer code or different customer codes? Anyway search here on Sopt for deletion of duplicate SQL records.
– anonimo