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
  • 399
  • 3
  • 17

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
  • 539,169
  • 125
  • 977
  • 1,137