Conceptually, Tom (as always) is right. But Alban's hack help.
DROP TABLE foo;
CREATE TABLE IF NOT EXISTS foo(ID INTEGER,G1 INTEGER, T1 TEXT, ID2 SERIAL
PRIMARY KEY);
INSERT INTO foo(ID,G1,T1) VALUES(1,2,'ABC');
INSERT INTO foo(ID,G1,T1) VALUES(1,2,'ABCD');
INSERT INTO foo(ID,G1,T1) VALUES(1,2,'A
BY "SIMILAR" but not equal values
alexandros_e writes:
> Is there a way in SQL or PostgreSQL in general to group by values than
> are not exactly the same but are quite similar (like 'ABC' and 'ABCD')
> based on some distance function (levenshtein for exa
On Thu, Feb 6, 2014 at 7:41 AM, Alban Hertroys wrote:
> On 6 February 2014 16:18, alexandros_e wrote:
>> Is there a way in SQL or PostgreSQL in general to group by values than are
>> not exactly the same but are quite similar (like 'ABC' and 'ABCD') based on
>> some distance function (levenshtein
On 6 February 2014 16:18, alexandros_e wrote:
> Let's say I have this table foo
>
> ID|G1|T1|
> 1|2|ABC|
> 1|2|ABCD|
> 1|2|DEF|
> 1|2|DEFG|
>
> SELECT * FROM foo
> GROUP BY ID,G1,T1
> Is there a way in SQL or PostgreSQL in general to group by values than are
> not exactly the same but are quite s
alexandros_e writes:
> Is there a way in SQL or PostgreSQL in general to group by values than are
> not exactly the same but are quite similar (like 'ABC' and 'ABCD') based on
> some distance function (levenshtein for example) if the distance is within
> some threshold (i.e., 1)
Well, you can GRO
I wanted to ask you the following question to all experts here.
Let's say I have this table foo
ID|G1|T1|
1|2|ABC|
1|2|ABCD|
1|2|DEF|
1|2|DEFG|
SELECT * FROM foo
GROUP BY ID,G1,T1
RETURNS exactly the same table.
Is there a way in SQL or PostgreSQL in general to group by values than are
not exa