GeekInterview.com
Series: Subject: Topic:
Question: 176 of 190

There is a % sign in one field of a column. What will be the query to find it?

'' Should be used before '%'.
Asked by: Interview Candidate | Asked on: Aug 31st, 2005
Showing Answers 1 - 18 of 18 Answers
staline

Answered On : Jun 28th, 2005

SELECT * FROM TABLE1 WHERE COL1 LIKE ''%' ESCAPE ''

  
Login to rate this answer.
siri

Answered On : Jul 7th, 2005

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.

  
Login to rate this answer.
carry

Answered On : Aug 31st, 2005

select * from table where col1 like '%%%' ESCAPE ''

  
Login to rate this answer.
rajeshkoripalli

Answered On : Sep 14th, 2005

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

  
Login to rate this answer.
virgilkumar

Answered On : Oct 11th, 2005

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

  
Login to rate this answer.
Rajesh

Answered On : Nov 8th, 2005

select * from dept where 1=decode(instr(loc,'%'),0,0,1)

  
Login to rate this answer.
Jai

Answered On : Nov 8th, 2005

select * from tab_name where col_name like '%\%%' escape '\';

Yes  2 Users have rated as useful.
  
Login to rate this answer.
Atul Takiar

Answered On : Nov 9th, 2005

select * from table_name where col_name like '% \% %' escape '\';

  
Login to rate this answer.
Indrajit Adhya

Answered On : Nov 9th, 2005

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

Yes  1 User has rated as useful.
  
Login to rate this answer.
pradeep

Answered On : Feb 9th, 2006

select * from emp where instr('ename','%')!=0

  
Login to rate this answer.

SELECT *
FROM table_nm
WHERE col_nm LIKE '%/%' escape'/';

  
Login to rate this answer.
dj_dj_dj

Answered On : May 6th, 2010

View all answers by dj_dj_dj

select *
from table_name
where code in
                      (select code
                        from table_name
                        where instr(column_name,'%') 
                        and instr(column_name,'%') > 0);



Regards
Dharmendra Jaiswal.

  
Login to rate this answer.

SQL> select * from name;

NAME
--------------------
Girija%Sankar
Girija,Sankar

SQL> select * from name where name like '%%%' escape '';

NAME
--------------------
Girija%Sankar

  
Login to rate this answer.
yasodha

Answered On : Aug 29th, 2011

consider that a person have a name like this 'k%ng'
He can be found by


last_name like'k@%ng'

  
Login to rate this answer.

the query is to find the name of the person starting with a
here is an example
select ename from emp where ename like a%;

  
Login to rate this answer.
abhishek

Answered On : Jul 17th, 2012

select * from emp where ename like ki\%ng escape ;

  
Login to rate this answer.
Nazeera Jaffar

Answered On : Sep 30th, 2012

The below code will select the row having column as %

Code
  1. SELECT *
  2. FROM table_name
  3. WHERE column_name LIKE !%escape!
  4.  

  
Login to rate this answer.
Nazeera Jaffar

Answered On : Oct 6th, 2012

The below code selects the column with a substring % (e.g.) reg%istration

Code
  1. SELECT * FROM game WHERE name LIKE %\%% escape ;

  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Ads

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.