coalesce es lo mismo que nvl de oracle no?
From: "Jaime Casanova" <systemguards@gmail.com>
To: "Javier Estévez CIFA Córdoba" <javier.estevez.ext@juntadeandalucia.es>
CC: pgsql-es-ayuda@postgresql.org
Subject: Re: [pgsql-es-ayuda] COUNT
Date: Mon, 27 Feb 2006 03:35:00 -0500
>On 2/27/06, Javier Estévez CIFA Córdoba
><javier.estevez.ext@juntadeandalucia.es> wrote:
> > Es posible que al realizar un count(*) me devuelva el valor 0 cuando
> > corresponda?
> >
> > Cómo puedo hacerlo?
> >
> > Gracias. Javier Estévez
> >
>
>estas pensando en sum...
>count siempre regresa un valor numerico >= 0
>
>respecto a tu pregunta... seria
>
>select coalesce(sum(campo), 0) from tabla
>
>--
>Atentamente,
>Jaime Casanova
>
>"What they (MySQL) lose in usability, they gain back in benchmarks, and that's
>all that matters: getting the wrong answer really fast."
> Randal L. Schwartz
>
>---------------------------(fin del mensaje)---------------------------
>TIP 3: si publicas/lees desde Usenet, por favor envía "subscribe-nomail"
> a majordomo@postgresql.org para que tus mensajes puedan llegar
> a los suscriptores de la lista