Home » Other » Training & Certification » need sql query
need sql query [message #268355] Tue, 18 September 2007 05:41 Go to next message
oracleram
Messages: 23
Registered: November 2006
Junior Member
Hi every1,

i have empno:A123ER in table Emp,i want to retrieve only the digits 123,i need a sql query to retrive digits from alphanumeric,Thanx in advance..

Thanks & Regards,

Ram
Re: need sql query [message #268361 is a reply to message #268355] Tue, 18 September 2007 06:03 Go to previous messageGo to next message
Arju
Messages: 1554
Registered: June 2007
Location: Dhaka,Bangladesh. Mobile:...
Senior Member

I can give you one solution. But need recursive usage of function.
Re: need sql query [message #268362 is a reply to message #268355] Tue, 18 September 2007 06:03 Go to previous messageGo to next message
Michel Cadot
Messages: 64119
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
FAQ and definitively not an expert question.

Regards
Michel
Re: need sql query [message #268366 is a reply to message #268355] Tue, 18 September 2007 06:10 Go to previous messageGo to next message
gauravsunil
Messages: 68
Registered: August 2007
Location: bhubaneswar
Member
select trim(trailing'E' from(trim(trailing'R' from (trim(leading'A' from 'A123ER'))))) 
from emp 
where empno='A123ER';

Regards
Sunil Gaurav

[Updated on: Tue, 18 September 2007 06:18] by Moderator

Report message to a moderator

Re: need sql query [message #268372 is a reply to message #268355] Tue, 18 September 2007 06:18 Go to previous message
Arju
Messages: 1554
Registered: June 2007
Location: Dhaka,Bangladesh. Mobile:...
Senior Member

select replace translate(column_name,'ABCDEFGHIJ......','                   '),' ',null) from table_name


or if you want to replace your wish
select translate(translate(column_name,'A',' '),'B',' ')..... from table_name
Previous Topic: Space check
Next Topic: any sql related questions for certifications
Goto Forum:
  


Current Time: Tue Dec 06 10:24:07 CST 2016

Total time taken to generate the page: 0.25108 seconds