X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 79429D1B8F2 for ; Tue, 19 Aug 2003 11:21:31 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 67853-02 for ; Tue, 19 Aug 2003 11:21:24 -0300 (ADT) Received: from anchor-post-39.mail.demon.net (anchor-post-39.mail.demon.net [194.217.242.80]) by svr1.postgresql.org (Postfix) with ESMTP id 3EE7CD1B900 for ; Tue, 19 Aug 2003 11:21:04 -0300 (ADT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-39.mail.demon.net with esmtp (Exim 3.36 #2) id 19p7MB-0001IB-0U; Tue, 19 Aug 2003 15:21:08 +0100 Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id C222116395; Tue, 19 Aug 2003 15:21:06 +0100 (BST) Received: from client17.archonet.com (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id 197B015913; Tue, 19 Aug 2003 15:21:06 +0100 (BST) From: Richard Huxton To: Rado Petrik , PostgreSQL-mailinglist Subject: Re: Query problem Date: Tue, 19 Aug 2003 15:21:05 +0100 User-Agent: KMail/1.5 References: <1061298143.14403.37.camel@caj> In-Reply-To: <1061298143.14403.37.camel@caj> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200308191521.05085.dev@archonet.com> X-Virus-Scanned: by AMaViS snapshot-20020531 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/220 X-Sequence-Number: 14836 On Tuesday 19 August 2003 14:02, Rado Petrik wrote: > id bit(dec) bit(bin) > ----------------------------- > 1 1 1 > 2 3 11 > 3 12 1100 > > > and I need query - > > > SELECT "output" FROM user WHERE id = 1 OR id = 2 or id = 3 > output = (1111) PG supports bit-strings which I guess are designed for exactly this situation. See the "data types" section of the manual for details. -- Richard Huxton Archonet Ltd