pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jose Ig Mendez <jmendez@andago.com>
To: pgsql-sql@postgresql.org
Cc: Pavel Stehule <pavel.stehule@gmail.com>
Subject: Re: newbie question * compare integer in a "where IN" statement
Date: Wed, 13 Jul 2011 14:33:03 +0200
Message-ID: <4E1D907F.6030908@andago.com> (raw)
In-Reply-To: <CAFj8pRCxb5PkQC7FBps4AJtwLZ4WsKxc1SLsg1P5Dqh4oAZZnw@mail.gmail.com>
References: <4E1C4322.5030001@andago.com>
	<4E1D4B0B.8070400@andago.com>
	<CAFj8pRCxb5PkQC7FBps4AJtwLZ4WsKxc1SLsg1P5Dqh4oAZZnw@mail.gmail.com>

Hi,

Thank you very much Pavel, that solves my problem

Regards

On 13/07/11 09:50, Pavel Stehule wrote:
> Hello
>
> you can try
>
> SELECT .. FROM .. WHERE id = ANY(string_to_array('1,2,3,4,5',','))
>
> other forms are slow
>
> Regards
>
> Pavel Stehule
>
> 2011/7/13 Jose Ig Mendez <jmendez@andago.com <mailto:jmendez@andago.com>>
>
>
>     Hi everybody,
>
>     I'm trying to compare in a sentence like this (using PostGres 8.3) :
>
>     select * from myTable where id_integer IN ('1,2,3,4')
>
>     I want to get the records which key "id_integer" is 1 or 2 or 3 or
>     4. the type od my "id", of course, is integer.
>
>     I've tried many differents ways but I cannot get the result I want.
>     I would like to cast the integer parameter I cannot change the
>     part after "IN" it has to be a "string list".
>
>     Do I have to use a function ? I would like not to use it.
>
>     How can I compare a key (integer) with a lists of values ?
>
>     I'm desperate
>
>     THANX IN ADVANCE
>
>     -- 
>     ------------------------------------------------------------------------
>
>     José Ignacio Méndez Yanes
>
>     Área de Operaciones / Area of Operations
>
>     Phone: +34 916 011 373 / +34 946 416 066
>
>     Mobile: +34 666 431 099
>
>     Fax: +34 916 011 372 / +34 944 318 286
>
>     Ándago 	Alcalde Ángel Arroyo 10, 1ª Planta. 28904. Getafe, Madrid
>     Kanala Bidea, Edif. 103, 1ª Izda. Parque Tecnológico. 48170.
>     Zamudio, Bizkaia
>     www.andago.com <http://www.andago.com;
>
>     Síguenos en: Twitter <http://twitter.com/andago; - Facebook
>     <http://www.facebook.com/pages/Andago/111911732048; - LinkedIn
>     <http://www.linkedin.com/groups?gid=1479457; - YouTube
>     <http://www.youtube.com/andagotv;
>
>     	Antes de imprimir este mensaje, asegúrese de que es necesario.
>     Consider the environment before printing this mail.
>
>     AVISO LEGAL
>
>     ------------------------------------------------------------------------
>
>     *ANDAGO CONSULTING SL / ANDAGO INGENIERÍA, SL* le informa que los
>     datos facilitados por Ud. y utilizados para el envío de esta
>     comunicación serán objeto de tratamiento automatizado o no en
>     nuestros ficheros, con la finalidad de gestionar la agenda de
>     contactos de nuestra empresa y para el envío de comunicaciones
>     profesionales por cualquier medio electrónico o no. Vd. podrá en
>     cualquier momento ejercer el derecho de acceso, rectificación,
>     cancelación y oposición en los términos establecidos en la Ley
>     Orgánica 15/1999. El responsable del tratamiento es ANDAGO
>     CONSULTING SL / ANDAGO INGENIERIA SL, con domicilio en C/ ALCALDE
>     ANGEL ARROYO, 10, 28904, Getafe (Madrid).
>
>     El contenido de esta comunicación, así como el de toda la
>     documentación anexa, es confidencial y va dirigido únicamente al
>     destinatario del mismo. En el supuesto de que usted no fuera el
>     destinatario, le solicitamos que nos lo indique y no comunique su
>     contenido a terceros, procediendo a su destrucción.
>
>     DISCLAIMER
>
>     ------------------------------------------------------------------------
>
>     The content of this communication and any attached information is
>     confidential and exclusively for the use of the addressee. If you
>     are not the addressee, we ask you to notify to the sender and do
>     not pass its content to another person, and please be sure you
>     destroy it.
>
>

-- 
------------------------------------------------------------------------

José Ignacio Méndez Yanes

Área de Operaciones / Area of Operations

Phone: +34 916 011 373 / +34 946 416 066

Mobile: +34 666 431 099

Fax: +34 916 011 372 / +34 944 318 286

Ándago 	Alcalde Ángel Arroyo 10, 1ª Planta. 28904. Getafe, Madrid
Kanala Bidea, Edif. 103, 1ª Izda. Parque Tecnológico. 48170. Zamudio, 
Bizkaia
www.andago.com <http://www.andago.com;

Síguenos en: Twitter <http://twitter.com/andago; - Facebook 
<http://www.facebook.com/pages/Andago/111911732048; - LinkedIn 
<http://www.linkedin.com/groups?gid=1479457; - YouTube 
<http://www.youtube.com/andagotv;

	Antes de imprimir este mensaje, asegúrese de que es necesario. Consider 
the environment before printing this mail.

AVISO LEGAL

------------------------------------------------------------------------

*ANDAGO CONSULTING SL / ANDAGO INGENIERÍA, SL* le informa que los datos 
facilitados por Ud. y utilizados para el envío de esta comunicación 
serán objeto de tratamiento automatizado o no en nuestros ficheros, con 
la finalidad de gestionar la agenda de contactos de nuestra empresa y 
para el envío de comunicaciones profesionales por cualquier medio 
electrónico o no. Vd. podrá en cualquier momento ejercer el derecho de 
acceso, rectificación, cancelación y oposición en los términos 
establecidos en la Ley Orgánica 15/1999. El responsable del tratamiento 
es ANDAGO CONSULTING SL / ANDAGO INGENIERIA SL, con domicilio en C/ 
ALCALDE ANGEL ARROYO, 10, 28904, Getafe (Madrid).

El contenido de esta comunicación, así como el de toda la documentación 
anexa, es confidencial y va dirigido únicamente al destinatario del 
mismo. En el supuesto de que usted no fuera el destinatario, le 
solicitamos que nos lo indique y no comunique su contenido a terceros, 
procediendo a su destrucción.

DISCLAIMER

------------------------------------------------------------------------

The content of this communication and any attached information is 
confidential and exclusively for the use of the addressee. If you are 
not the addressee, we ask you to notify to the sender and do not pass 
its content to another person, and please be sure you destroy it.

Attachments:

  [image/gif] logo-blanco.gif (2.8K, ../4E1D907F.6030908@andago.com/3-logo-blanco.gif)
  download | view image

  [image/jpeg] medio-ambiente.jpg (1.2K, ../4E1D907F.6030908@andago.com/4-medio-ambiente.jpg)
  download | view image

view thread (5+ messages)

Message-ID: <4E1D907F.6030908@andago.com>
Permalink:  ../4E1D907F.6030908@andago.com/
Also on:    postgresql.org/message-id/4E1D907F.6030908@andago.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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: jmendez@andago.com, pavel.stehule@gmail.com
  Subject: Re: newbie question * compare integer in a "where IN" statement
  In-Reply-To: <4E1D907F.6030908@andago.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