2012/9/14 Marcone <[email protected]>

> > select codigo, nome from tcliente where ativo = 1 and empresa between
> coalesce($1,0) and coalesce($1,999)
>
> Cara... não achei legal essa. Esses casos eu trabalho da seguinte forma:
>
> select codigo, nome from tcliente where ativo = 1 and ((empresa = $1)
> or ($1 is null))
>
>
Melhor ainda... :-)

-- 
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL
>> Blog sobre TI: http://fabriziomello.blogspot.com
>> Perfil Linkedin: http://br.linkedin.com/in/fabriziomello
>> Twitter: http://twitter.com/fabriziomello
_______________________________________________
pgbr-geral mailing list
[email protected]
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral

Responder a