On Sat, 15 Oct 2005 08:49:15 +
"paperinik 100" <[EMAIL PROTECTED]> threw this fish to the penguins:
> PostgreSQL is 7.4.7.
>
> My first table
> CREATE TABLE tb_cat (
> id INTEGER,
> desc text
> );
> INSERT INTO tb_cat VALUES (10, 'cat10');
> INSERT INTO tb_cat VALUES (20, 'cat20');
> INSERT I
Ya, I didn't test it.
The error message was expecting an integer not an
array, so coverting it to a list crossed my mind
'assuming' the subselect 'could' return a string of
integers for the IN clause.
Oh well. I'm glad there's people like you test it.
--- Michael Fuhr <[EMAIL PROTECTED]> wrote:
On Tue, Oct 18, 2005 at 08:09:48PM -0700, Matthew Peter wrote:
> Not sure if you got this figured out but I think
>
> SELECT * from tb_cat WHERE id IN (SELECT
> array_to_string(cat,',') as cat FROM tb_array WHERE
> id=1);
>
> is what your looking for?
I doubt it, considering that it doesn't work
Not sure if you got this figured out but I think
SELECT * from tb_cat WHERE id IN (SELECT
array_to_string(cat,',') as cat FROM tb_array WHERE
id=1);
is what your looking for?
--- paperinik 100 <[EMAIL PROTECTED]> wrote:
> PostgreSQL is 7.4.7.
>
> My first table
> CREATE TABLE tb_cat (
> id I
PostgreSQL is 7.4.7.
My first table
CREATE TABLE tb_cat (
id INTEGER,
desc text
);
INSERT INTO tb_cat VALUES (10, 'cat10');
INSERT INTO tb_cat VALUES (20, 'cat20');
INSERT INTO tb_cat VALUES (30, 'cat30');
My second table
CREATE TABLE tb_array(
id INTEGER,
cat INTEGER[]
);
INSERT INTO tb_array V