Re: Como cambio campos

From: Javier Chávez B(dot) <jchavezb(at)gmail(dot)com>
To: "Alvaro Herrera" <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: "Fabian Sandoval" <sql(at)transitofloridablanca(dot)gov(dot)co>, pgsql-es-ayuda(at)postgresql(dot)org
Subject: Re: Como cambio campos
Date: 2008-11-05 18:35:36
Message-ID: ded64bba0811051035y2b0598a0m3bb8cf3a98f5f51b@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

On Wed, Nov 5, 2008 at 6:34 PM, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> wrote:
> Javier Chávez B. escribió:
>
>> UPDATE ttamlice SET licservicio = '02' WHERE liccateg in( '04','05','06')
>> UPDATE ttamlice SET licservicio = '03' WHERE liccateg in( '01','02','03')
>
> Mejor todavia:
>
> update ttamlice set licservicio = case
> when liccateg in ('04', '05', '06') then '02'
> when liccateg in ('01', '02', '03') then '03'
> end
> where liccated in ('01, '02', '03', '04', '05', '06')

Mas elegante de echo :0)

> --
> Alvaro Herrera Valdivia, Chile ICBM: S 39º 48' 55.3", W 73º 15' 24.7"
> "Digital and video cameras have this adjustment and film cameras don't for the
> same reason dogs and cats lick themselves: because they can." (Ken Rockwell)
>

--
Cumprimentos
jchavez
linux User #397972 on http://counter.li.org/

In response to

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Moises Alberto Lindo Gutarra 2008-11-05 19:34:29 Re: Mantenimiento
Previous Message Alvaro Herrera 2008-11-05 18:34:43 Re: Como cambio campos