Grouping By Similarity (using pg_trgm)?

Поиск
Список
Период
Сортировка
От Cory Tucker
Тема Grouping By Similarity (using pg_trgm)?
Дата
Msg-id CAG_=8kBQk-3eesdZ-7iAH-x0oCX=Ob7Qekbp-y9rEM71smBZrQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: Grouping By Similarity (using pg_trgm)?
Re: Grouping By Similarity (using pg_trgm)?
Список pgsql-general
[pg version 9.3 or 9.4]

Suppose I have a simple table:

create table data (
  my_value  TEXT NOT NULL
);
CREATE INDEX idx_my_value ON data USING gin(my_value gin_trgm_ops);


Now I would like to essentially do group by to get a count of all the values that are sufficiently similar.  I can do it using something like a CROSS JOIN to join the table on itself, but then I still am getting all the rows with duplicate counts.  

Is there a way to do a group by query and only return a single "my_value" column and a count of the number of times other values are similar while also not returning the included similar values in the output, too?

В списке pgsql-general по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: ECPG SET CONNECTION
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Grouping By Similarity (using pg_trgm)?