[Pgsql-ayuda] select

Jose Ayala - INCALPACA TPX jayala@incalpaca.com
Tue, 29 Apr 2003 15:29:14 -0500


This is a multi-part message in MIME format.

------=_NextPart_000_018C_01C30E64.17401520
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Paola la forma correcta es usando el comparador like de la sig manera:

SELECT descrip FROM Usuarios where sucursal like '%" & Paso & "%' order =
by descrip

Suerte

 Jose J. Ayala Pineda
Sistemas e Inform=E1tica
   Incalpaca TPX S.A.
  www.incalpaca.com
  ----- Original Message -----=20
  From: Paola Paredes A=20
  To: pgsql-ayuda@tlali.iztacala.unam.mx=20
  Sent: Monday, April 28, 2003 12:05 PM
  Subject: [Pgsql-ayuda] select


  Hola a todos, mi duda es bien peque=F1a

  Quiero seleccionar todas las columnas en donde el campo sucursal =
contenga la variable paso al medio.
  paso=3D5;
  SELECT descrip FROM Usuarios where sucursal =3D '%" & Paso & "%' order =
by descrip

  pero no recoge nada...

  si la consulta la hago en psql:=20
  SELECT descrip FROM Usuarios where sucursal =3D '%5%' order by descrip =
tampoco encuentra nada

  Mi duda es como se coloca el % o si se utiliza otro comod=EDn

  Gracias=20

  Paola Paredes

------=_NextPart_000_018C_01C30E64.17401520
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV>
<DIV><FONT face=3DArial size=3D2>Paola la forma correcta es usando el =
comparador=20
like de la sig manera:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV>
<DIV><FONT face=3DArial size=3D2>SELECT descrip FROM Usuarios where=20
sucursal&nbsp;like '%" &amp; Paso &amp; "%' order by =
descrip</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Suerte</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;Jose J. Ayala Pineda<BR>Sistemas =
e=20
Inform=E1tica<BR>&nbsp;&nbsp; Incalpaca TPX S.A.<BR>&nbsp; <A=20
href=3D"http://www.incalpaca.com">www.incalpaca.com</A></FONT></DIV></DIV=
></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV=20
  style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
  <A title=3Dlista_linux@logros.cl =
href=3D"mailto:lista_linux@logros.cl">Paola=20
  Paredes A</A> </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A=20
  title=3Dpgsql-ayuda@tlali.iztacala.unam.mx=20
  =
href=3D"mailto:pgsql-ayuda@tlali.iztacala.unam.mx">pgsql-ayuda@tlali.izta=
cala.unam.mx</A>=20
  </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Monday, April 28, 2003 =
12:05=20
  PM</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> [Pgsql-ayuda] =
select</DIV>
  <DIV><BR></DIV>
  <DIV><FONT face=3DArial size=3D2>Hola a todos, mi duda es bien=20
peque=F1a</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>Quiero seleccionar todas las columnas =
en donde el=20
  campo sucursal contenga&nbsp;la variable paso al medio.</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>paso=3D5;</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>SELECT descrip FROM Usuarios where =
sucursal =3D '%"=20
  &amp; Paso &amp; "%' order by descrip</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>pero no recoge nada...</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>si la consulta la hago en psql: =
</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>
  <DIV><FONT face=3DArial size=3D2>SELECT descrip FROM Usuarios where =
sucursal =3D=20
  '%5%' order by descrip tampoco encuentra nada</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV>Mi duda es como se coloca el % o si se utiliza otro =
comod=EDn</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>Gracias </DIV>
  <DIV>&nbsp;</DIV>
  <DIV>Paola Paredes</DIV></FONT></DIV>
  <DIV>&nbsp;</DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_018C_01C30E64.17401520--