SELECT DISTINCT COL_A, COL_B, COL_C, COL_D, from Table_E
If I want to only consider COL_A's duplication, how to use DISTINCT properly only for the COL_A?
SELECT DISTINCT COL_A, COL_B, COL_C, COL_D, from Table_E
If I want to only consider COL_A's duplication, how to use DISTINCT properly only for the COL_A?
Use DISTINCT ON
:
SELECT DISTINCT ON (COL_A) COL_A, COL_B, COL_C, COL_D FROM Table_E;
See: