Check out example codes for "postgresql remove duplicate rows 2 columns". It will help you in understanding the concepts better.

Code Example 1

DELETE FROM sf_table
WHERE id IN
    (SELECT id
    FROM 
        (SELECT id,
         ROW_NUMBER() OVER( PARTITION BY tosp, icd
        ORDER BY  id ) AS row_num
        FROM sf_table ) t
        WHERE t.row_num > 1 );

Learn ReactJs, React Native from akashmittal.com