Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id D52C0632840 for ; Sat, 2 May 2009 14:55:32 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 28631-01 for ; Sat, 2 May 2009 14:55:29 -0300 (ADT) X-Greylist: delayed 00:59:58.646081 by SQLgrey-1.7.6 Received: from wavecable.net (mail3.wavecable.com [24.113.32.25]) by mail.postgresql.org (Postfix) with ESMTP id 354F163282F for ; Sat, 2 May 2009 14:55:31 -0300 (ADT) Received: from [76.14.161.10] (HELO [192.168.1.215]) by wavecable.net (CommuniGate Pro SMTP 4.2.8) with ESMTP id 152273371 for pgsql-sql@postgresql.org; Sat, 02 May 2009 09:46:29 -0700 From: johnf To: pgsql-sql@postgresql.org Subject: using a list to query Date: Sat, 2 May 2009 09:55:29 -0700 User-Agent: KMail/1.9.6 (enterprise 20070904.708012) MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200905020955.29386.jfabiani@yolo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200905/5 X-Sequence-Number: 32497 I have a list (or array) of primary keys stored in a field (data type text). I would like to use the list to retrieve all the data from a table based on the list. my text field contains: '123,134,343,345' I would to do something like the following: Select * from table1 where table1.pkid in (select myTextfield from table2) So the question is there a simple way to use the list to retrieve my data? -- John Fabiani