X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id CDB349DC9FB for ; Wed, 18 Jan 2006 13:05:17 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 82489-06 for ; Wed, 18 Jan 2006 13:05:15 -0400 (AST) Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 088739DC9E1 for ; Wed, 18 Jan 2006 13:05:14 -0400 (AST) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by svr4.postgresql.org (Postfix) with ESMTP id E34C05AF043 for ; Wed, 18 Jan 2006 17:05:13 +0000 (GMT) Received: from root by ciao.gmane.org with local (Exim 4.43) id 1EzGgl-0006Wd-AS for pgsql-sql@postgresql.org; Wed, 18 Jan 2006 18:01:39 +0100 Received: from 208.4.59.132 ([208.4.59.132]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 18 Jan 2006 18:01:39 +0100 Received: from vrajmohan by 208.4.59.132 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 18 Jan 2006 18:01:39 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-sql@postgresql.org From: Vraj Mohan Subject: Re: Matching several rows Date: Wed, 18 Jan 2006 11:35:39 -0500 Lines: 19 Message-ID: References: <3578f52e0601172043s64561353i689350a1c5d4debb@mail.gmail.com> <3578f52e0601180622h5035935ch5e64c018fde16f91@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 208.4.59.132 User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en In-Reply-To: <3578f52e0601180622h5035935ch5e64c018fde16f91@mail.gmail.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=1.253 required=5 tests=[RCVD_NUMERIC_HELO=1.253] X-Spam-Score: 1.253 X-Spam-Level: * X-Archive-Number: 200601/124 X-Sequence-Number: 23913 It is easier to think of this as SET INTERSECTION which leads to: SELECT id FROM urights WHERE right = 2 INTERSECT SELECT id FROM urights WHERE right = 5 INTERSECT SELECT id FROM urights WHERE right = 10 Ivan Steganov wrote: > Thank you to everyone for the great help! > > I will evaluate all methods in our query (It is actually well complexer then > this sample) and choose the best one. > > Is there any "scientific" name to this kind of "several rows match for one > result" data selection? > > Ivan >