|
create table tablename (
a char (10),
b char (10),
c int)
insert into tablename
select 'aa', 'bb', 0
union all
select 'cc', 'dd', 1
select tablename. *, value = case when c = 0 then a else b end from tablename
result:
a b c value
aa bb 0 aa
cc dd 1 dd |
|