Need help in grouping records

Поиск
Список
Период
Сортировка
Искать
От
Andreas
Тема
Need help in grouping records
Дата
в 16:04:54
Msg-id
4FB7EEC6.1030004@gmx.net
Список
Дерево обсуждения
Re: Need help in grouping records Jasen Betts <jasen@xnet.co.nz>
Re: Need help in grouping records Andreas <maps.on@gmx.net>
master/detail Jan Bakuwel <jan.bakuwel@greenpeace.org>
Re: master/detail Andreas Kretschmer <andreas@a-kretschmer.de>
Re: master/detail Jan Bakuwel <jan.bakuwel@greenpeace.org>
Re: master/detail "Raj Mathur (राज माथुर)" <raju@linux-delhi.org>
Re: master/detail Mario Dankoor <m.p.dankoor@gmail.com>
Hi,

I'm trying to fight against double entries in tables.
I got as far as I can find similar records with trigram string matching.
If I do this with a table compared to itself I get something like this:

id_a, id_b
3,   5
3,   7
5,   3
5,   7
7,   3
7,   5
11,   13
13,   11

so the records with the IDs 3, 5, 7 and 11, 13 are similar enough to 
form a group.

How would I get a list of record-IDs with a group-ID like this

record_id, group_id
3,   1
5,   1
7,   1
11,   2
13,   2


Is there a way to get this by SQL ?

В списке pgsql-sql по дате отправления
От: Scott Marlowe
Дата:
От: Jasen Betts
Дата:
FAQ