0
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?

Dong-gyun Kim
  • 411
  • 5
  • 23

1 Answers1

1

Use DISTINCT ON:

SELECT DISTINCT ON (COL_A) COL_A, COL_B, COL_C, COL_D FROM Table_E;

See:

Erwin Brandstetter
  • 605,456
  • 145
  • 1,078
  • 1,228