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,229, 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-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 4:58 AM
Points: 39,893, Visits: 36,240
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: Tuesday, September 9, 2014 3:27 AM
Points: 1,893, Visits: 2,329
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
Posted Tuesday, August 26, 2014 4:50 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Yesterday @ 7:22 AM
Points: 2,944, Visits: 242
Two wilds.
Post #1607624
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse