2017-05-08 138 views

回答

0

试试这个

select col1,col2,...., case when colN ='TÜRKEI' then 'TR' else colN end as colN 
from your_table 
0

假设列名col,你

您可以使用SQL标准case

select t.*, case when col = 'TÜRKEI' then 'TR' else col end as col_new 
from your_table t; 

或Oracle特定decode

select t.*, decode(col, 'TÜRKEI', 'TR', col) as col_new 
from your_table t; 

如果你想用值来更新表,你可以简单的更新

update your_table 
set col = 'TR' 
where col = 'TÜRKEI'; 
0

如果你想改变数据库中的值,那么你必须使用更新声明。 SQL UPDATE语句用于更新现有记录在表中。

e.g

update tablename 
set column1 = value 
where condition;