Click here to Skip to main content
14,360,151 members
Rate this:
Please Sign up or sign in to 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 22:10pm

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

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[^]
   
v3
Comments
   
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, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100