newbie question * compare integer in a "where IN" statement - Mailing list pgsql-sql

From Jose Ig Mendez
Subject newbie question * compare integer in a "where IN" statement
Date
Msg-id 4E1C4322.5030001@andago.com
Whole thread Raw
List pgsql-sql
Hi everybody,<br /><br /> I'm trying to compare in a sentence like this (using PostGres 8.3) :<br /><br /> select *
frommyTable where id_integer IN ('1,2,3,4')<br /><br /> I want to get the records which key "id_integer" is 1 or 2 or 3
or4. the type od my "id", of course, is integer.<br /><br /> I've tried many differents ways but I cannot get the
resultI want. <br /> I would like to cast the integer parameter I cannot change the part after "IN" it has to be a
"stringlist".<br /><br /> Do I have to use a function ? I would like not to use it.<br /><br /> How can I compare a key
(integer)with a lists of values ?<br /><br /> I'm desperate<br /><br /> THANX IN ADVANCE<br /><br /><div
class="moz-signature">--<br /></div><hr style="color: #0c62b7; font-weight: bold; margin=0; padding:0" /><div
class="vcard"style="font-family: Arial, Sans; font-size: 9pt; color:#666;       margin: 0; padding: 0;"><p class="fn n"
style="color:#0c62b7;font-weight: bold; margin: 0; padding:         0"><span class="given-name">José Ignacio</span>
<spanclass="additional-name">Méndez Yanes</span><p class="note" style="color:#f8c454; font-weight: bold; margin: 0;
padding:        0">Área de Operaciones / Area of Operations<p style="margin: 0; padding: 0">Phone: <span class="tel"
style="font-weight:bold; color: #333;">+34 916 011 373</span> / <span class="tel" style="font-weight: bold; color:
    #333;">+34 946 416 066</span><p style="margin: 0; padding: 0">Mobile: <span class="tel" style="font-weight: bold;
color:#333;">+34 666 431 099</span><p style="margin: 0; padding: 0">Fax: <span style="font-weight:           bold;
color:#333;">+34 916 011 372</span> / <span style="font-weight: bold; color: #333;">+34 944 318 286</span><table
style="border:none; margin: 0; padding: 0; font-size:         8pt"><tbody><tr style="margin: 0; padding: 0;"><td><img
align="left"alt="Ándago" class="org" height="72" hspace="1" src="cid:part1.01070102.05040608@andago.com" vspace="3"
width="120"/></td><td><span class="adr" style="color: #333;"><span class="street-address">Alcalde Ángel Arroyo 10, 1ª
Planta</span>.<span class="postal-code">28904</span>. <span class="locality">Getafe</span>, <span
class="region">Madrid</span></span><br/><span class="adr" style="color: #333;"><span class="street-address">Kanala
Bidea,Edif. 103, 1ª Izda. Parque Tecnológico</span>. <span class="postal-code">48170</span>. <span
class="locality">Zamudio</span>,<span class="region">Bizkaia</span></span><br /><span class="nombre"><a class="url"
href="http://www.andago.com"style="color:#0c62b7; text-decoration: none;                   font-weight:
bold;">www.andago.com</a></span></td></tr></tbody></table></div><pstyle="margin: 0; padding: 0;"><span
style="font-size:8pt;">Síguenos en: <a href="http://twitter.com/andago" style="color:#0c62b7; text-decoration: none;
      font-weight: bold;">Twitter</a> - <a href="http://www.facebook.com/pages/Andago/111911732048"
style="color:#0c62b7;text-decoration: none;           font-weight: bold;">Facebook</a> - <a
href="http://www.linkedin.com/groups?gid=1479457"style="color:#0c62b7; text-decoration: none;           font-weight:
bold;">LinkedIn</a>- <a href="http://www.youtube.com/andagotv" style="color:#0c62b7; text-decoration: none;
font-weight:bold;">YouTube</a></span><table style="border: none;"><tbody><tr><td width="30"><img align="left" alt=""
height="20"hspace="1" src="cid:part2.01080707.07010801@andago.com" vspace="3" width="30" /></td><td><span class="arbol"
style="font-size:9pt; color:#038000;">Antes de imprimir este mensaje, asegúrese de que es necesario. Consider the
environmentbefore printing this mail.</span></td></tr></tbody></table><p style="color:#0c62b7; font-size: 7pt;
font-weight:bold;       text-align: center; margin: 0; padding: 0">AVISO LEGAL<hr style="color:#0c62b7; margin: 0;
padding:0" /><p style="font-size: 7pt; margin: 0; padding: 0"><b>ANDAGO CONSULTING SL / ANDAGO INGENIERÍA, SL</b> le
informaque los datos facilitados por Ud. y utilizados para el envío de esta comunicación serán objeto de tratamiento
automatizadoo no en nuestros ficheros, con la finalidad de gestionar la agenda de contactos de nuestra empresa y para
elenvío de comunicaciones profesionales por cualquier medio electrónico o no. Vd. podrá en cualquier momento ejercer el
derechode acceso, rectificación, cancelación y oposición en los términos establecidos en la Ley Orgánica 15/1999. El
responsabledel tratamiento es ANDAGO CONSULTING SL / ANDAGO INGENIERIA SL, con domicilio en C/ ALCALDE ANGEL ARROYO,
10,28904, Getafe (Madrid).<p style="font-size: 7pt; margin: 0; padding: 0">El contenido de esta comunicación, así como
elde toda la documentación anexa, es confidencial y va dirigido únicamente al destinatario del mismo. En el supuesto de
queusted no fuera el destinatario, le solicitamos que nos lo indique y no comunique su contenido a terceros,
procediendoa su destrucción. <p style="color:#0c62b7; font-size: 7pt; font-weight: bold;       text-align: center;
margin:0; padding: 0">DISCLAIMER<hr style="color:#0c62b7; margin: 0; padding: 0" /><p style="font-size: 7pt; margin: 0;
padding:0">The content of this communication and any attached information is confidential and exclusively for the use
ofthe addressee. If you are not the addressee, we ask you to notify to the sender and do not pass its content to
anotherperson, and please be sure you destroy it.  

pgsql-sql by date:

Previous
From: "B.Rathmann"
Date:
Subject: Looking for a "show create table " equivalent
Next
From: Scott Marlowe
Date:
Subject: Re: Max column number.