GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Oracle  >  SQL
Go To First  |  Previous Question  |  Next Question 
 SQL  |  Question 15 of 171    Print  
There is a % sign in one field of a column. What will be the query to find it?
'' Should be used before '%'.



  
Total Answers and Comments: 10 Last Update: February 09, 2006   
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: Indrajit Adhya
 

We have to use ESCAPE character.

If job column if emp table has '%' ex.('vb%dev') then

SELECT * FROM EMP where job like '%/%%' escape '/'

Here '/' ESCAPE character



Above answer was rated as good by the following members:
hemajyothi012
June 28, 2005 01:54:20   #1  
staline        

RE: There is a % sign in one field of a column. What will be the query to find it?
SELECT * FROM TABLE1 WHERE COL1 LIKE '' ' ESCAPE ''
 
Is this answer useful? Yes | No
July 07, 2005 14:32:09   #2  
siri        

RE: There is a % sign in one field of a column. What will be the query to find it?
correct syntax is
SELECT * FROM TABLE WHERE COL LIKE ' 9! ' ESCAPE '!'
THIS RETURNS THE VALUES THAT CONTAIN 9
THE FIRST AND THE LAST PERCENT SIGNS ARE WILDCARD CHARACTERS AND ! SIGN IS THE ECAPE CHARACTER.

 
Is this answer useful? Yes | No
August 31, 2005 12:59:58   #3  
carry        

RE: There is a % sign in one field of a column. What will be the query to find it?
select * from table where col1 like ' ' ESCAPE ''
 
Is this answer useful? Yes | No
September 14, 2005 04:55:00   #4  
rajeshkoripalli        

RE: There is a % sign in one field of a column. What w...

suppose consider a table named as symbol containing

SQL> select * from symbol;

CHARACTER NAME
---------- ----------
modfun
# hash

SQL> select * from symbol where character ' ';

CHARACTER NAME
---------- ----------
modfun


 
Is this answer useful? Yes | No
October 11, 2005 03:07:52   #5  
virgilkumar        

RE: There is a % sign in one field of a column. What w...

use escape key word.Example a string is like this aru n.In this u want to find the .Then use like 'aru# # 'escape#.Try this


 
Is this answer useful? Yes | No
November 08, 2005 04:07:07   #6  
Rajesh        

RE: There is a % sign in one field of a column. What w...
select * from dept where 1 decode(instr(loc ' ') 0 0 1)
 
Is this answer useful? Yes | No
November 08, 2005 05:11:25   #7  
Jai        

RE: There is a % sign in one field of a column. What w...
select * from tab_name where col_name like ' \ ' escape '\';
 
Is this answer useful? Yes | No
November 09, 2005 06:02:54   #8  
Atul Takiar        

RE: There is a % sign in one field of a column. What w...
select * from table_name where col_name like ' \ ' escape '\';
 
Is this answer useful? Yes | No
November 09, 2005 13:24:13   #9  
Indrajit Adhya        

RE: There is a % sign in one field of a column. What w...

We have to use ESCAPE character.

If job column if emp table has ' ' ex.('vb dev') then

SELECT * FROM EMP where job like ' / ' escape '/'

Here '/' ESCAPE character


 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
February 09, 2006 15:08:45   #10  
pradeep        

RE: There is a % sign in one field of a column. What w...
select * from emp where instr('ename' ' ')! 0
 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape