using a list to query

From: johnf <jfabiani(at)yolo(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: using a list to query
Date: 2009-05-02 16:55:29
Message-ID: 200905020955.29386.jfabiani@yolo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Isaac Dover 2009-05-02 18:52:25 Fwd: Comparing two tables of different database
Previous Message Lucas Brito 2009-05-02 15:01:09 Re: Comparing two tables of different database