pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: A. Kretschmer <andreas.kretschmer@schollglas.com>
To: pgsql-sql@postgresql.org
Subject: Re: Arrya variable as argument to IN expression
Date: Thu, 17 Nov 2005 10:26:38 +0100
Message-ID: <20051117092638.GF20828@webserv.wug-glas.de> (raw)
In-Reply-To: <20051117082851.65703.qmail@web32704.mail.mud.yahoo.com>
References: <20051117082851.65703.qmail@web32704.mail.mud.yahoo.com>

am  17.11.2005, um  0:28:51 -0800 mailte Emil Kaffeshop folgendes:
> Hello I am trying the following:
> a INTEGER[] := ''{10,15,20}'';
> b INTEGER := 15;
> flag BOOLEAN := FALSE;
> 
> SELECT b IN (a) INTO flag; !!! does not work

Sorry, i can't understand your query.

Perhaps you are searchfing for something like:

test=# select * from foo;
    a    | b | flag
---------+---+------
 {1,2,3} | 1 | t
 {5,6,7} | 1 | t
(2 rows)

test=# select * from foo where b = any(a);
    a    | b | flag
---------+---+------
 {1,2,3} | 1 | t
(1 row)


> 
> Is it legal to expect the array to be interpret as
> list of integers which IN expression takes ?

Please read http://www.postgresql.org/docs/8.1/interactive/arrays.html
to learn more about arrays.


HTH, Andreas
-- 
Andreas Kretschmer    (Kontakt: siehe Header)
Heynitz:  035242/47212,      D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
 ===    Schollglas Unternehmensgruppe    === 



view thread (4+ messages)  latest in thread

Message-ID: <20051117092638.GF20828@webserv.wug-glas.de>
Permalink:  ../20051117092638.GF20828@webserv.wug-glas.de/
Also on:    postgresql.org/message-id/20051117092638.GF20828@webserv.wug-glas.de

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: andreas.kretschmer@schollglas.com
  Subject: Re: Arrya variable as argument to IN expression
  In-Reply-To: <20051117092638.GF20828@webserv.wug-glas.de>

* 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