Re:

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Alejandro Carrillo <fasterzip(at)yahoo(dot)es>
Cc: alexis gonzalez <dlexo09(at)gmail(dot)com>, Ayuda <pgsql-es-ayuda(at)postgresql(dot)org>
Subject: Re:
Date: 2012-05-10 20:40:26
Message-ID: 1336682201-sup-6431@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda


Excerpts from Alejandro Carrillo's message of jue may 10 16:25:24 -0400 2012:

> Muestra todos los registros donde la columna1 sea igual a 1 y 2

Quieres decir "igual a 1 O 2", no "y". ¿Quién le enseña lógica a los
niños, por estos días, me pregunto?

> select * from tablaOK t where t.columna1 = all(1,2);
>
> Resultado:2 registros

alvherre=# create table tabla (a int, b text);
CREATE TABLE
alvherre=# insert into tabla values (1, 'hola'), (2, 'jaja'), (3, 'jiji');
INSERT 0 3

Este es un "o":

alvherre=# select * from tabla t where t.a = any (array[1, 2]);
a | b
---+------
1 | hola
2 | jaja
(2 filas)

Este es un "Y":

alvherre=# select * from tabla t where t.a >= all (array[1, 2]);
a | b
---+------
2 | jaja
3 | jiji
(2 filas)

--
Álvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>

In response to

  • Re: at 2012-05-10 20:25:24 from Alejandro Carrillo

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Javier Aquino 2012-05-10 20:44:54 Re:
Previous Message ruben avila galindo 2012-05-10 20:29:43 Re: Mensaje en Log