Re: Como cambio campos

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Javier Chávez B(dot) <jchavezb(at)gmail(dot)com>
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:34:43
Message-ID: 20081105183443.GR4114@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

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')

--
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)

In response to

Responses

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Javier Chávez B. 2008-11-05 18:35:36 Re: Como cambio campos
Previous Message Javier Chávez B. 2008-11-05 18:31:58 Re: Como cambio campos