From: | salah jubeh <s_jubeh(at)yahoo(dot)com> |
---|---|
To: | Chris Travers <chris(dot)travers(at)gmail(dot)com> |
Cc: | pgsql <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: tubles matching |
Date: | 2011-09-28 15:54:31 |
Message-ID: | 1317225271.67557.YahooMailNeo@web161504.mail.bf1.yahoo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Thanks Chris, this solution is one alternative, but it will not work in my app because the join condition in your example is defined using all the fields. in my case the join condition is unknown. if a row in the first view is a subset of a row in the second view that means there is a match.
Regards
________________________________
From: Chris Travers <chris(dot)travers(at)gmail(dot)com>
To:
Cc: salah jubeh <s_jubeh(at)yahoo(dot)com>; pgsql <pgsql-general(at)postgresql(dot)org>
Sent: Wednesday, September 28, 2011 5:09 PM
Subject: Re: [GENERAL] tubles matching
Is something like this what you are trying to do?
somedb=# create table a (a int, b text, c date);
CREATE TABLE
somedb=# create table b (a int, b text, c date);
CREATE TABLE
somedb=# select * from a join b using (a, b, c);
a | b | c
---+---+---
(0 rows)
somedb=# insert into a values (1, 'test', now());
INSERT 0 1
somedb=# insert into b values (1, 'test', now());
INSERT 0 1
somedb=# insert into b values (2, 'test', now());
INSERT 0 1
somedb=# select * from a join b using (a, b, c);
a | b | c
---+------+------------
1 | test | 2011-09-28
(1 row)
Best wishes,
Chris Travers
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2011-09-28 16:12:47 | Re: What about improving the rules system we have, was Re: Rules going away |
Previous Message | Rob Sargent | 2011-09-28 15:53:48 | Re: Rules going away |