Text removal after space [message #169] |
Wed, 23 January 2002 11:43  |
jjd
Messages: 1 Registered: January 2002
|
Junior Member |
|
|
Is there a function to edit a text column and remove anything after a space?
Ex - file that produces Peter P. and I just want Peter?
Any help would be appreciated-jd
|
|
|
|
Re: Text removal after space [message #201 is a reply to message #169] |
Mon, 28 January 2002 01:27   |
Diwakar Bhandari
Messages: 7 Registered: January 2002
|
Junior Member |
|
|
I assume that U want only 'Peter' to be displayed while the column in the table contains 'Peter P' .
Do something like this ...(insert statement used is only for demonstration purpose)
sql>insert into emp values(7897,'Peter P','Clerk',7902,null,null,null,null );
1 row created.
sql>select substr(ename,1,instr(ename,' '))as Name from emp where empno = 7897;
NAME
----------
Peter
Hope this helps
Diwakar
|
|
|
|