Check out example codes for "delete duplicates with sql". It will help you in understanding the concepts better.

Code Example 1

WITH cte AS (
    SELECT 
        *, 
        ROW_NUMBER() OVER (
            PARTITION BY 
                Name,
                Age
            ORDER BY 
                Name,
                Age
        ) row_num
     FROM 
        TableName
)
delete FROM cte
WHERE row_num > 1;

Learn ReactJs, React Native from akashmittal.com