decode command [message #373372] |
Fri, 13 April 2001 08:32 |
yonca
Messages: 3 Registered: April 2001
|
Junior Member |
|
|
how can i use decode command like that
decode(name,'ay%','ayse')
|
|
|
Re: decode command [message #373374 is a reply to message #373372] |
Fri, 13 April 2001 08:56 |
Madhav Kasojjala
Messages: 42 Registered: November 2000
|
Member |
|
|
like this
select
DECODE(PassFailStatus,'X','N/A','Y','Yes','N','No') training_session_passed
from Results;
decode( column_value/expression, old_value1,
New_Value_u_want1, old_value2,
New_Value_u_want3,...., default_value)
HTH
Madhav
|
|
|
Re: decode command [message #373394 is a reply to message #373374] |
Fri, 13 April 2001 12:22 |
Andrew again...
Messages: 270 Registered: July 2000
|
Senior Member |
|
|
create table tst (id number, name varchar2(10));
insert into tst values (1, 'abc');
insert into tst values (2, 'ay');
insert into tst values (3, 'ayaaa');
insert into tst values (4, 'aybbb');
insert into tst values (5, 'ayse');
select id, name, decode(substr(name, 1, 2), 'ay', 'ayse', name) from tst;
|
|
|