-
Hi
I have inserted some data starting with _(underscore). I would like to query the column to get the only the underscore rows. Can any one help me?
rammi
-
select column_name from your_table
where column_name like '_%';
Hope it helps
Cheers
Fabien
-
Hi
Thanks for the reply. But that doesnt work. It fetches all the rows. Any other solutions?
rammi
-
Originally posted by ramya_ram
Hi
Thanks for the reply. But that doesnt work. It fetches all the rows. Any other solutions?
This is a solution, not a suggestion :-)
Code:
select column_name from your_table
where substr(column_name,1,1) = '_';
-
select column_name from your_table
where column_name like '\ _\%' ESCAPE '\' ;
-
Hi
The substr option is working fine. But I wanted to know the other query which I tried and getting no rows. I have given the results below for your reference.
1 select type from type_designation_tab
2* where substr(type,1,1)='_'
TYPE
------------------------------
_IBMNETFINITY4500R
_NETFINITY5600
_DELLPWREDG1300
_NETVISTACELERON
_IBM-PIII
SQL> select type from type_designation_tab
2 where type like '\_\%' ESCAPE '\';
no rows selected
SQL>
rammi
-
Ramya, try this:
select type from type_designation_tab
where type LIKE '%^_%' ESCAPE '^';
This shd work.
-
Hi,
Why u require a % before the _(underscore) when the requirement is the rows starting from _(underscore)..
i think the query should be
select type from type_designation_tab
where type LIKE '^_%' ESCAPE '^';
Hope i am right..
thanks pras
-
Hi
Thanks a lot. It is working fine.
rammi
-
You are right Pras. I was just putting forth the syntax, didn't observe the specific.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|