From: Aarni Ruuhimäki <aarni@kymi.com>
To: pgsql-sql@postgresql.org
Subject: Querying a list field against another list
Date: Fri, 26 Nov 2004 16:17:57 +0200
Message-ID: <200411261617.57381.aarni@kymi.com> (raw)
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]
----- The following addresses had permanent fatal errors -----
<jens@headlong.se>
-----Transcript of session follows -----
... while talking to postoffice.local.:
>>> RCPT To:<jens@headlong.se>
<<< 550 5.1.1 unknown or illegal alias: jens@headlong.se
550 <jens@headlong.se>... 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
--------------------------------------
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 = '1,4' and want to find
all rows from foo where da_list contains '1' or '4'. So loop over bar to loop
over da_list in foo ?
My humble thanks,
Aarni
--------------
This is a bugfree broadcast to you
from **Kmail**
on **Fedora Core 2** linux system
--------------
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: aarni@kymi.com
Subject: Re: Querying a list field against another list
In-Reply-To: <200411261617.57381.aarni@kymi.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox