Home » SQL & PL/SQL » SQL & PL/SQL » How can I fin '_'-mark in text-string
How can I fin '_'-mark in text-string [message #188155] Thu, 17 August 2006 05:46 Go to next message
te5elahj
Messages: 3
Registered: August 2006
Junior Member
Hi,

I have a table TEST_TABLE and column TEST_COLUMN. I need to find those rows where in '_'-mark.
WHERE TEST_COLUMN LIKE '%'||'_'||'%'
Didn't because it's same as '%'. How can I find '_'-mark?

BR Karri
Re: How can I fin '_'-mark in text-string [message #188156 is a reply to message #188155] Thu, 17 August 2006 05:48 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
WHERE instr(test_column,'_') > 0
Re: How can I fin '_'-mark in text-string [message #188158 is a reply to message #188156] Thu, 17 August 2006 05:49 Go to previous messageGo to next message
te5elahj
Messages: 3
Registered: August 2006
Junior Member
Thanks A LOT
Re: How can I fin '_'-mark in text-string [message #188192 is a reply to message #188155] Thu, 17 August 2006 07:12 Go to previous messageGo to next message
gbarbisan
Messages: 67
Registered: August 2006
Location: Treviso - Italy
Member
 WHERE TEST_COLUMN LIKE '%\_%' ESCAPE '\';
Re: How can I fin '_'-mark in text-string [message #188370 is a reply to message #188155] Fri, 18 August 2006 04:21 Go to previous messageGo to next message
jaydeep mitra
Messages: 20
Registered: August 2006
Location: India
Junior Member
Hi,
Assume my table name is LGN having column name po_id.The po_id column has values po_1,po_2,po3.So the following query

select po_id from lgn where length(po_id) - length(replace(po_id,'_',null))!=0


will return po_1,po_2 only .
Hope this might solve your problem.

Regards
Jaydeep Mitra
PH: 91-9440499806

Re: How can I fin '_'-mark in text-string [message #188386 is a reply to message #188155] Fri, 18 August 2006 05:44 Go to previous message
jaydeep mitra
Messages: 20
Registered: August 2006
Location: India
Junior Member
Hi ,
select po_id from lgn where po_id like '%__%' escape '_'.
this is in response to my early reply.This is the easiest solution.To print only those rows which has '_' character in it.
Previous Topic: Bulk Collect Error
Next Topic: Comparing two tables
Goto Forum:
  


Current Time: Fri Dec 06 23:29:10 CST 2024