From: Eveling Velásquez <lingso13(at)yahoo(dot)es>
To: Pgsql-es-ayuda <pgsql-es-ayuda(at)postgresql(dot)org>
Subject:
Date: 2015-05-11 22:44:07
Message-ID: 1247677808.7405626.1431384247233.JavaMail.yahoo@mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

Buen diaTengo una duda, estoy realizando la siguiente consulta, los datos que me devuelven son correctos, sin embargo, lo que necesito es que me liste tambien los que suman 0. de que manera es posible hacer esta consulta, siempre y cuando se cumplan con los criterios que especifique?
la consulta es la siguiente
select d.id, d.nombre, count (e.id)from tabla1 e ,tabla2 p, tabla3 m, tabla4 d, tabla5 s
wheree.id=s.idand p.m=m.idand m.d=d.idand e.p=p.idand e.f = '04-05-2015'
group by 1,2

el resultado es 
id    nombre count1    amarillo    33    rojo           54    negro        1
lo que quiero obtener es
id    nombre count1    amarillo    32    celeste     03    rojo           54    negro        15    verde        0 Gracias de antemano

Eveling 

Responses

  • Re: at 2015-05-11 22:52:25 from raul andrez gutierrez alejo
  • Re: at 2015-05-12 16:00:45 from Jaime Casanova

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message raul andrez gutierrez alejo 2015-05-11 22:52:25 Re:
Previous Message MARIA ANTONIETA RAMIREZ SOLIS 2015-05-11 16:26:11 QUERY PARA SABER LAS COLUMNAS DE LAS TABLAS Y SUS LLAVES PRIMARIAS