suppose in table named customer has a column named ename having values like james,john
,suji_paric,scott_tiger.
i want retrieve the column value like
james
john
suji
scott
Printable View
suppose in table named customer has a column named ename having values like james,john
,suji_paric,scott_tiger.
i want retrieve the column value like
james
john
suji
scott
Use the following statement
SQL> select substr(name,1,decode(instr(name,'_'),0,length(name),instr(name,'_')-1))
from test_data;
SUBSTR(NAME,1,DECODE
--------------------
james
john
suji
scott
there r many ways 2 do this
[url]http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:766825833740[/url]
or search google pivot query