pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jose' Soares Da Silva <sferac@bo.nettuno.it>
To: Dim Zegebart <zager@post.comstar.ru>
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] querying array
Date: Tue, 9 Jun 1998 14:50:50 +0000 (UTC)
Message-ID: <Pine.LNX.3.96.980609145010.2779A-100000@proxy.bazzanese.com> (raw)
In-Reply-To: <357D2A38.4892C577@post.comstar.ru>

On Tue, 9 Jun 1998, Dim Zegebart wrote:

> 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 ?
> 
select * from foo where foo.n[1]=5 or foo.n[2]=5 or foo.n[4]=5;
n
---------
{4,7,8,5}
{4,5}
(2 rows)
                                Jose'




view thread (2+ messages)

Message-ID: <Pine.LNX.3.96.980609145010.2779A-100000@proxy.bazzanese.com>
Permalink:  ../Pine.LNX.3.96.980609145010.2779A-100000@proxy.bazzanese.com/
Also on:    postgresql.org/message-id/Pine.LNX.3.96.980609145010.2779A-100000@proxy.bazzanese.com

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: sferac@bo.nettuno.it, zager@post.comstar.ru
  Subject: Re: [SQL] querying array
  In-Reply-To: <Pine.LNX.3.96.980609145010.2779A-100000@proxy.bazzanese.com>
  References: <357D2A38.4892C577@post.comstar.ru> <Pine.LNX.3.96.980609145010.2779A-100000@proxy.bazzanese.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