Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

LIKE operator Expand / Collapse
Author
Message
Posted Thursday, August 14, 2008 12:14 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, April 19, 2012 10:25 PM
Points: 1,231, Visits: 3,483
Adequate and nice to learn
To get the exact result

select * from #Like_Test
where Col1 Like '%Cu[_]%'

‘_’ is escape so
[_] is the valuable one
Post #552428
Posted Monday, August 18, 2008 1:41 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 4:42 PM
Points: 41,516, Visits: 34,431
Or

select * from #Like_Test
where Col1 Like '%Cu/_%' ESCAPE '/'




Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #554132
Posted Wednesday, September 10, 2008 12:51 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Sunday, February 26, 2012 1:57 AM
Points: 57, Visits: 32
Try this to get the records start with "Cu_"

select * from #Like_Test where Col1 Like 'Cu[_]%'
Post #567224
Posted Tuesday, December 11, 2012 3:08 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: 2 days ago @ 11:50 PM
Points: 1,867, Visits: 2,275
good basic question of LIKE..
I like it



_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Post #1394986
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse