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

'' Should be used before '%'.

Showing Answers 1 - 18 of 18 Answers

staline

  • Jun 28th, 2005
 

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

  Was this answer useful?  Yes

siri

  • 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.

  Was this answer useful?  Yes

carry

  • Aug 31st, 2005
 

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

  Was this answer useful?  Yes

rajeshkoripalli

  • 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

  Was this answer useful?  Yes

virgilkumar

  • 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

  Was this answer useful?  Yes

Rajesh

  • Nov 8th, 2005
 

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

  Was this answer useful?  Yes

Jai

  • Nov 8th, 2005
 

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

Atul Takiar

  • Nov 9th, 2005
 

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

  Was this answer useful?  Yes

Indrajit Adhya

  • 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

pradeep

  • Feb 9th, 2006
 

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

  Was this answer useful?  Yes

dj_dj_dj

  • May 6th, 2010
 

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



Regards
Dharmendra Jaiswal.

  Was this answer useful?  Yes

yasodha

  • Aug 29th, 2011
 

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


last_name like'k@%ng'

  Was this answer useful?  Yes

abhishek

  • Jul 17th, 2012
 

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

  Was this answer useful?  Yes

Nazeera Jaffar

  • 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.  

  Was this answer useful?  Yes

Nazeera Jaffar

  • 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 ;

  Was this answer useful?  Yes

Give your answer:

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

 

Related Answered Questions

 

Related Open Questions