querying array

From: Dim Zegebart <zager(at)post(dot)comstar(dot)ru>
To: pgsql-sql(at)postgresql(dot)org
Subject: querying array
Date: 1998-06-09 12:27:36
Message-ID: 357D2A38.4892C577@post.comstar.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,
is there any way to do selection from table by testing array attribute
for
presence of defined value ?
SQL speaking :
create tabel foo(n int2[]);
insert into foo (n) values('{1,2,3}');
insert into foo (n) values('{4,7,8,5}');
insert into foo (n) values('{4,5}');
//now I want to select only exeplars with n containing '5'. It should be
second and third records :
select * from foo where foo.n?????
//That I shoud type next ?

Thank in advance.

--
____ ____
| \ / Dim Zegebart
____/____

Moscow Russia
WWW - http://www.geocities.com/siliconvalley/pines/7817

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Herouth Maoz 1998-06-09 12:55:46 Re: [SQL] questions
Previous Message Lendvary Gyorgy 1998-06-09 12:01:39 questions