Re: update

Поиск
Список
Период
Сортировка
От denis@coralindia.com
Тема Re: update
Дата
Msg-id 007601c1bf50$c36130a0$0232a8c0@coralindia.com
обсуждение исходный текст
Ответ на update  ("cristi" <cristi@dmhi.ct.ro>)
Список pgsql-novice
TRy
 
update my_table set codlm='22'||substring(codlm,3) where substr(codlm,1,2) = '45'
 
HTH
 
Denis
 
----- Original Message -----
From: cristi
Sent: Tuesday, February 26, 2002 12:13 PM
Subject: [NOVICE] update

I have a table (my_table) with this structure:
codlm varchar(7)
 
The records are:
45122AD
45122AD
45123AC
440331B
430332C
440222X
I want to change the first 2 letters from 45 to 22 something like this:
 
22122AD
22122AD
22123AC
440331B
430332C
440222X
I tried:
update my_table set codlm='22'||substring(codlm,2) where codlm like '45'
 
but the result is:

 225
 225
 225
 440331B
 430332C
 440222X
Where is the mistake?
 
Thanks!

В списке pgsql-novice по дате отправления:

Предыдущее
От: "Josh Berkus"
Дата:
Сообщение: Re: Major newbie - Part deux
Следующее
От: "cristi69"
Дата:
Сообщение: Re: update