X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 626D03A49E8 for ; Fri, 26 Nov 2004 14:18:04 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 66182-10 for ; Fri, 26 Nov 2004 14:17:59 +0000 (GMT) Received: from pales.kymp.net (postimies.kymp.net [80.248.96.135]) by svr1.postgresql.org (Postfix) with ESMTP id 211643A49EC for ; Fri, 26 Nov 2004 14:17:58 +0000 (GMT) Received: from [192.168.16.100] (adsl-241-66.kymp.net [213.130.241.66]) by pales.kymp.net (8.12.9/8.12.9) with SMTP id iAQE60sT025501 for ; Fri, 26 Nov 2004 16:06:00 +0200 From: Aarni =?iso-8859-1?q?Ruuhim=E4ki?= Reply-To: aarni@kymi.com Organization: KYMI.com Subject: Querying a list field against another list Date: Fri, 26 Nov 2004 16:17:57 +0200 User-Agent: KMail/1.6.2 To: pgsql-sql@postgresql.org MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Message-Id: <200411261617.57381.aarni@kymi.com> X-Virus-Scanned: by amavisd-new X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200411/264 X-Sequence-Number: 19582 Hi, I tried to mail this to the novice list I believe it was rejected: >> The original message was received at 2004-11-26 14:55:09 +0100 from postoffice.local [10.0.0.1] =A0 =A0----- The following addresses had permanent fatal errors ----- =A0 =A0-----Transcript of session follows ----- =2E.. while talking to postoffice.local.: >>> RCPT To: <<< 550 5.1.1 unknown or illegal alias: jens@headlong.se 550 ... User unknown >> So here's my question. Hi people, This is not quite a pg question, but any suggestions are most welcome. How can one query a list of values against a db field that contains a list = of values ? Table foo foo_id | foo_name | da_list =2D------------------------------------- 1 | x | 1,2,3,4,5 2 | y | 1,4,5 3 | z | 4,5,11 4 | xyz | 14,15,33 As a result from another query I have parameter bar =3D '1,4' and want to f= ind all rows from foo where da_list contains '1' or '4'. So loop over bar to lo= op over da_list in foo ? My humble thanks, Aarni =2D------------- This is a bugfree broadcast to you from **Kmail** on **Fedora Core 2** linux system =2D-------------