Re: [Pgsql-ayuda] Full outer join

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: jtaaribi <jtaaribi(at)terra(dot)es>
Cc: Martin Marques <martin(at)bugs(dot)unl(dot)edu(dot)ar>, pgsql-ayuda(at)tlali(dot)iztacala(dot)unam(dot)mx
Subject: Re: [Pgsql-ayuda] Full outer join
Date: 2003-12-23 12:59:32
Message-ID: 20031223125931.GD13577@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

On Tue, Dec 23, 2003 at 09:55:22AM +0100, jtaaribi wrote:
> Muchas gracias Martín por tu respuesta y perdona por haberme equivocado con
> tu nombre ;-)
>
> Con los datos del caso del ejemplo que he puesto, sí que valdría con OR.
> Pero no en general, ya que quiero que se cumplan _ambas_ condiciones a la
> vez pero sin excluir los null.

No entiendo por que no sirve WHERE a=2 OR a IS NULL ?

> Se me ha ocurrido una nueva SQL:
>
> select tt1.num, tt2.num, tt1.col1, tt2.col3
> from (select t1.num, t1.col1, t1.col2 from
> t1 where t1.col2 = 1) tt1
> full outer join
> (select t2.num, t2.col3, t2.col4 from
> t2 where t2.col4 = 5) tt2 on
> tt1.num = tt2.num

Parece razonable ...

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"La felicidad no es mañana. La felicidad es ahora"

In response to

Responses

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Martin Marques 2003-12-23 13:13:08 Re: [Pgsql-ayuda] Full outer join
Previous Message Alvaro Herrera 2003-12-23 12:56:47 Re: [Pgsql-ayuda] N Procesadores (Es la solucion)