how to use arrays?

From: Viorel Anghel <vang(at)altavista(dot)net>
To: pgsql-sql(at)postgreSQL(dot)org
Subject: how to use arrays?
Date: 1999-02-03 17:49:36
Message-ID: 19990203124936.E13507@zeus.advatech.ro
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Let's assume the following structure:
create table T1 (name char(20), code int[]);
insert into T1 values('abcd', '{1,2,3}');
...
insert into T1 values('xyz', '{3,1}');

Now i want to select all names which contains code=1
SELECT name FROM T1 WHERE 1=T1.code[1] or 1=T1.code[2] ... etc ???

--
___
<o-o> Viorel ANGHEL <vang(at)altavista(dot)net>
[`-']
-"-"-

Browse pgsql-sql by date

  From Date Subject
Next Message Andy 1999-02-03 18:16:03 Two table select
Previous Message Johann Spies 1999-02-03 15:53:33 Re: [PyGreSQL] referencial keys foreign keys