Check out example codes for "query to remove duplicate records in postgresql server". It will help you in understanding the concepts better.

Code Example 1

DELETE FROM
    basket a
        USING basket b
WHERE
    a.id < b.id
    AND a.fruit = b.fruit;

Learn ReactJs, React Native from akashmittal.com