you can get rid of the numbers by:
substitute(yourcolumn,'012
Main Topics
Browse All TopicsHi,
i have a query my task is to find whether the particular string is present or not
here is my query
select substr(col_name,1,length('
length(substr(col_name,1,l
here the table1 has
WOGENRESOURC
this data is not the same as WOGENRESOUR but it retruning this value i can also add the conditon
like length(col_name)=length('W
WOGENRESOURC
WOGENRESOUR1
in this case i need the query to retrun WOGENRESOUR bcoz the numerals at the end was added by someother manipulation but the data is same
and can anyone help me with this query
Thanks
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I still don't understand why it is so complicated..
your problem: my task is to find whether the particular string is present or not
lets consider the following scenario.
1. you want the exact match.
select col_name from table1
where col_name='WOGENRESOUR';
2. the string 'WOGENRESOUR' can be present in any place in the column data
select substr(col_name,instr(col_
where instr(col_name,'WOGENRESOU
3. the string 'WOGENRESOUR' should be at the start in the column
select substr(col_name,1,length('
where instr(col_name,'WOGENRESOU
or
select substr(col_name,1,length('
where col_name like 'WOGENRESOUR%';
I hope this will resolve all your queries... just try it on your data depending on what scenario you are looking for. I think you are looking for scenario 3.
cheers,
Ajay
here is the example for your reference:
SQL> create table sampletable (col varchar2(100));
Table created.
SQL> insert into sampletable values ('WOGENRESOURC');
1 row created.
SQL> insert into sampletable values ('WOGENRESOUR1');
1 row created.
SQL> insert into sampletable values ('othervalue');
1 row created.
SQL> commit;
Commit complete.
SQL> select col
2 from sampletable
3 where instr(col,'WOGENRESOUR') = 1;
COL
--------------------------
WOGENRESOURC
WOGENRESOUR1
SQL>
With this test data:
insert into sampletable values ('WOGENRESOURC');
insert into sampletable values ('WOGENRESOUR1');
Your query produces:
COL
------------
WOGENRESOURC
WOGENRESOUR1
I meant to use TRANSLATE, not SUBSTITUTE in my query above, and I think he wants:
select 'WOGENRESOUR' as col
from sampletable
where translate(col,'.0123456789
COL
-----------
WOGENRESOUR
He gave the example as:
>here the table1 has
> WOGENRESOURC
>
>this data is not the same as WOGENRESOUR but it retruning this value i can also add the conditon
So, he does NOT want to return WOGENRESOURC. He adds a condition to eliminate this from his results:
>length(col_name)=length('
But then this will not be selected:
>WOGENRESOUR1
So if you have a table with
WOGENRESOUR
WOGENRESOURC
WOGENRESOUR1
it appears he only wants the first and third entry.
>you already know "WOGENRESOUR", why you bother to "GET" "WOGENRESOUR"?
Because his select was:
substr(col_name,1,length('
That will always resolve to WOGENRESOUR, so I decided to eliminate the function.
Business Accounts
Answer for Membership
by: mahee999Posted on 2006-06-22 at 06:20:09ID: 16959614
can we use instr function to find that staring position of the any numeric value ...