Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: Campos Booleanos


  • From: "Miguel Rodríguez Penabad" <penabad(at)gmail(dot)com>
  • To: "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>
  • Cc: "Rodrigo Gil Giuliano" <gilgiuliano(at)yahoo(dot)com(dot)ar>, "Postgres - Lista en español" <pgsql-es-ayuda(at)postgresql(dot)org>
  • Subject: Re: Campos Booleanos
  • Date: Thu, 28 Feb 2008 00:19:01 +0100
  • Message-id: <95335e4e0802271519ve2e58b4n3e5084e892bb4aad(at)mail(dot)gmail(dot)com>

> select case when campo_booleano then 'SI' else 'NO' end
>   from tabla

Para completar (por si los nulos) creo que sería mejor

select case
    when campo_booleano then 'SI'
    when not campo_booleano then 'NO'
    else null -- el else sería opcional
end from tabla


-- 
Miguel Rodríguez Penabad



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group