Originally posted by DaPi translate(initcap(column),
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz',
'ABCDEFGHIJKLMNOPQRSTUVWXYZ')
Will deal with any number of names - but I feel there must be a neater way . . .
you are something..!!!
PHP Code:
create table test_to_del
(
name varchar2(20)
);
insert into test_to_del values ('saM len');
insert into test_to_del values ('a b');
insert into test_to_del values ('q v');
select replace(translate(initcap(name),
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz',
'ABCDEFGHIJKLMNOPQRSTUVWXYZ'),' ','')
from test_to_del;
REPLACE(TRANSLATE(IN
--------------------
SL
AB
QV
Originally posted by rshivagami select substr(names,1,1) || substr(names, instr(names,' ')+1,1) from tablename;
You might want to add a decode before the second concatenation to check if there is a space.
Thanks shivagami,
but I am not able to get the correct output.can you pls show me how it works by using the decode.
For instance samantha Mary - it should display the initial as SM
but as per the above query it is displaying only S
Bookmarks