Click here to Skip to main content
15,881,778 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
how to find out the existing lines, and eliminate the existing values?

tanya.png - Google Drive[^]

What I have tried:

I have tried it with looping, it turns out the data is all gone for the NAMA_OLD column

what I want to find is the DUPLIKAT_PENGAWAS column, if there is one that is the same it will delete one of the columns from the NAMA_OLD column.

thanks I need this help
Posted
Updated 16-Jul-19 21:10pm

1 solution

In SQL that would be something like:
SELECT DUPLIKAT_PENGAWAS FROM Mytable
WHERE (((DUPLIKAT_PENGAWAS) In 
  (SELECT [DUPLIKAT_PENGAWAS] FROM [Mytable] As Tmp GROUP BY [DUPLIKAT_PENGAWAS] 
  HAVING Count(*)>1 )))
ORDER BY DUPLIKAT_PENGAWAS;
For deleting see examples here: delete all duplicate rows in a table (if a row is duplicated once, both rows should be deleted)[^]

You might also be interested in the DISTINCT selection: c# - How to select distinct rows in a datatable and store into an array - Stack Overflow[^]
 
Share this answer
 
v3
Comments
M Ridwan Dwi Septian 17-Jul-19 3:17am    
i dont use sql command.. i use datatable in C1FlexGrid
RickZeeland 17-Jul-19 3:25am    
I know, you can try to "translate" the SQL to Datatable commands.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900