Thread: Distinct + Limit

Distinct + Limit

From
Francois Deliege
Date:
Hi group,

I have the following table with millions of rows

CREATE TABLE table1
(
  col1 text,
col1 text,
  doc text
)

select col1 from table1 group by col1 limit 2;
select distinct on (col1) col1 from table1 limit 2;