Home » SQL & PL/SQL » SQL & PL/SQL » Search with special character ('%')
Search with special character ('%') [message #323013] Tue, 27 May 2008 01:31 Go to next message
LaxmiRam
Messages: 2
Registered: May 2008
Junior Member
Frndz...

do help me out in this regard


i want to retrieve records that have names with special character..(%)

i mean for example...

name
xyz
abc
a%t
but%%t


now i want only records with
a%t
but%%t to be displayed!!!!!!


Lakshmi

[mod-edit]adjusted title

[Updated on: Tue, 27 May 2008 01:38] by Moderator

Report message to a moderator

Re: Search with special character ('%') [message #323016 is a reply to message #323013] Tue, 27 May 2008 01:40 Go to previous messageGo to next message
Michel Cadot
Messages: 64153
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Use ESCAPE option of LIKE.

Regards
Michel
Re: Search with special character ('%') [message #323018 is a reply to message #323013] Tue, 27 May 2008 01:42 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
If you'd bothered to have a peek at some other threads you would have found something like this:
select yourcolumn
from   yourtable
where  yourcolumn like '%\%%' escape '\'


In SQL*Plus, you can use 'SET ESCAPE <some_character>' to set your escape character.

MHE
Re: Search with special character ('%') [message #323038 is a reply to message #323018] Tue, 27 May 2008 02:46 Go to previous message
sunil.madnani
Messages: 36
Registered: March 2007
Location: BHILAI
Member
Try This

SELECT * FROM NAME
WHERE INSTR(NAME,'%')>0
Previous Topic: Search through Wild Card character
Next Topic: Random Password Generation
Goto Forum:
  


Current Time: Sun Dec 11 00:36:27 CST 2016

Total time taken to generate the page: 0.07317 seconds