﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Article Discussions / Article Discussions by Author / Discuss content posted by Susantha Bathige  / LIKE operator / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Fri, 24 May 2013 16:23:23 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: LIKE operator</title><link>http://www.sqlservercentral.com/Forums/Topic551602-1325-1.aspx</link><description>good basic question of LIKE..I like it :-P</description><pubDate>Tue, 11 Dec 2012 03:08:51 GMT</pubDate><dc:creator>kapil_kk</dc:creator></item><item><title>RE: LIKE operator</title><link>http://www.sqlservercentral.com/Forums/Topic551602-1325-1.aspx</link><description>Try this to get the records start with "Cu_"select * from #Like_Test where Col1 Like 'Cu[_]%'</description><pubDate>Wed, 10 Sep 2008 12:51:55 GMT</pubDate><dc:creator>Deepak Jain-691547</dc:creator></item><item><title>RE: LIKE operator</title><link>http://www.sqlservercentral.com/Forums/Topic551602-1325-1.aspx</link><description>Or[code]select * from #Like_Testwhere Col1 Like '%Cu/_%' ESCAPE '/'[/code]</description><pubDate>Mon, 18 Aug 2008 01:41:13 GMT</pubDate><dc:creator>GilaMonster</dc:creator></item><item><title>RE: LIKE operator</title><link>http://www.sqlservercentral.com/Forums/Topic551602-1325-1.aspx</link><description>Adequate and nice to learnTo get the exact resultselect * from #Like_Test where Col1 Like '%Cu[_]%'‘_’ is escape so[_] is the valuable one</description><pubDate>Thu, 14 Aug 2008 00:14:21 GMT</pubDate><dc:creator>arun.sas</dc:creator></item><item><title>RE: LIKE operator</title><link>http://www.sqlservercentral.com/Forums/Topic551602-1325-1.aspx</link><description>create table #Like_Test(  Col1 varchar(5) )insert #Like_Test values('_Cus')insert #Like_Test values('Cus_')insert #Like_Test values('C_us')insert #Like_Test values('Cus')insert #Like_Test values('Cu_s')select * from #Like_Test where Col1 Like '%Cu_%'How can we really get the row with value as "Cu_" then?(I mean the last record in the above table)Something like this doesnt works..   select * from #Like_Test where Col1 Like '%[Cu_]%'</description><pubDate>Wed, 13 Aug 2008 23:08:09 GMT</pubDate><dc:creator>sudhanva</dc:creator></item><item><title>RE: LIKE operator</title><link>http://www.sqlservercentral.com/Forums/Topic551602-1325-1.aspx</link><description>Good Question ....:)</description><pubDate>Wed, 13 Aug 2008 11:32:28 GMT</pubDate><dc:creator>Anipaul</dc:creator></item><item><title>RE: LIKE operator</title><link>http://www.sqlservercentral.com/Forums/Topic551602-1325-1.aspx</link><description>Good question, and a learning experience for meI missed it too, not realizing that the underscore wouldn't catch 'C_us'.    The lesson learned is that underscore as a wildcard means that there MUST be some character, but % will accept the absence of a character.   Proved this out by modifying your question a touch.create table #Like_Test(  Col1 varchar(5) )goinsert #Like_Test values('_Cu')insert #Like_Test values('_Cus')insert #Like_Test values('Cus_')insert #Like_Test values('C_us')insert #Like_Test values('Cus')insert #Like_Test values('Cu_s')select * from #Like_Testwhere Col1 Like '%Cu_%'select * from #Like_Testwhere Col1 Like '%Cu%'select * from #Like_Testwhere Col1 Like '%C%u%'drop table #like_test</description><pubDate>Wed, 13 Aug 2008 10:33:21 GMT</pubDate><dc:creator>The Dixie Flatline</dc:creator></item><item><title>RE: LIKE operator</title><link>http://www.sqlservercentral.com/Forums/Topic551602-1325-1.aspx</link><description>You can also escape the wildcard characters with square-brackets.[code]where col like '[_]'[/code]or[code]where col like '[%]'[/code]</description><pubDate>Wed, 13 Aug 2008 08:08:29 GMT</pubDate><dc:creator>GSquared</dc:creator></item><item><title>RE: LIKE operator</title><link>http://www.sqlservercentral.com/Forums/Topic551602-1325-1.aspx</link><description>It was good question. I create confusion for underscore. I just like  logical</description><pubDate>Wed, 13 Aug 2008 07:33:26 GMT</pubDate><dc:creator>bhusank_neuronimbus</dc:creator></item><item><title>RE: LIKE operator</title><link>http://www.sqlservercentral.com/Forums/Topic551602-1325-1.aspx</link><description>Tricky, tricky! Good question though. I fell into the trap probably because I haven't had enough coffee yet this morning. I saw the % signs and just completely forgot about the _ as a wildcard.</description><pubDate>Wed, 13 Aug 2008 06:58:41 GMT</pubDate><dc:creator>jim.powers</dc:creator></item><item><title>RE: LIKE operator</title><link>http://www.sqlservercentral.com/Forums/Topic551602-1325-1.aspx</link><description>Nice one. To be honest: what I [i]expected[/i] wasn't the right answer ;) But after testing it I knew what was :)Thanks for the lesson in wildcard characters!</description><pubDate>Wed, 13 Aug 2008 04:26:14 GMT</pubDate><dc:creator>A_A_R_T</dc:creator></item><item><title>RE: LIKE operator</title><link>http://www.sqlservercentral.com/Forums/Topic551602-1325-1.aspx</link><description>This one was quite simple (even for a n00b like myself :D)But a good try anyways...</description><pubDate>Wed, 13 Aug 2008 04:21:20 GMT</pubDate><dc:creator>Jochen Vleming</dc:creator></item><item><title>RE: LIKE operator</title><link>http://www.sqlservercentral.com/Forums/Topic551602-1325-1.aspx</link><description>for a second i thought  :w00t:.... nice question</description><pubDate>Wed, 13 Aug 2008 02:14:29 GMT</pubDate><dc:creator>ChiragNS</dc:creator></item><item><title>LIKE operator</title><link>http://www.sqlservercentral.com/Forums/Topic551602-1325-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/questions/T-SQL/63671/"&gt;LIKE operator&lt;/A&gt;[/B]</description><pubDate>Tue, 12 Aug 2008 23:28:07 GMT</pubDate><dc:creator>Susantha Bathige</dc:creator></item></channel></rss>