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 4B25A9DC80F for ; Wed, 18 Jan 2006 00:43:23 -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 31320-04 for ; Wed, 18 Jan 2006 00:43:21 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from uproxy.gmail.com (uproxy.gmail.com [66.249.92.199]) by postgresql.org (Postfix) with ESMTP id 34D119DC86F for ; Wed, 18 Jan 2006 00:43:19 -0400 (AST) Received: by uproxy.gmail.com with SMTP id s2so134066uge for ; Tue, 17 Jan 2006 20:43:18 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=SlG+YxYK0OsA1nV0A/4o7WPScK21+K35VTHCAGtIIhPYAEkMVVwdyZzmsUgtA1VZ5I6+FlLTsmdkvaTJosnjdgVtPCX2KVk8PWlDoTim2yMZdf6KWIXixOhCy7BqbSxOYh6/FVdYtZNHxvTiD38s3xeLX8s3l1xMFVsAaNqlF8w= Received: by 10.49.17.20 with SMTP id u20mr386031nfi; Tue, 17 Jan 2006 20:43:18 -0800 (PST) Received: by 10.49.66.13 with HTTP; Tue, 17 Jan 2006 20:43:18 -0800 (PST) Message-ID: <3578f52e0601172043s64561353i689350a1c5d4debb@mail.gmail.com> Date: Wed, 18 Jan 2006 05:43:18 +0100 From: Ivan Steganov To: pgsql-sql@postgresql.org Subject: Matching several rows MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1761_18724635.1137559398495" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=1.333 required=5 tests=[HTML_MESSAGE=0.001, RCVD_IN_BL_SPAMCOP_NET=1.332] X-Spam-Score: 1.333 X-Spam-Level: * X-Archive-Number: 200601/109 X-Sequence-Number: 23898 ------=_Part_1761_18724635.1137559398495 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi, This is possibly absolutely trivial but I am lost... A table URIGHTS which stores an ID and the RIGHTs this ID has. One ID may have many rights and accordingly records in table, sample: ID RIGHT --------------------- 20 1 20 2 20 5 20 10 30 2 30 10 Now I need to find out which IDs have, say rights 2 AND 5 AND 10. What would be the simplest query? Thanks! ------=_Part_1761_18724635.1137559398495 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi,

This is possibly absolutely trivial but I am lost...

A ta= ble URIGHTS which stores an ID and the RIGHTs this ID has. One ID may have = many rights and accordingly records in table, sample:

ID  =      RIGHT
---------------------
20        1
2= 0        2
20     &nbs= p;  5
20        10
30   =      2
30        10
Now I need to find out which IDs have, say rights 2 AND 5 AND 10.
<= br>What would be the simplest query?

Thanks! ------=_Part_1761_18724635.1137559398495--