SQL QUERY

What's the query if I want to select all records whose columnA (contains string) contain the word "sentense" in its string?  I used lik'%sentense%' but that's not wroking.
Thanks.
lapuccaAsked:
Who is Participating?
 
Aneesh RetnakaranConnect With a Mentor Database AdministratorCommented:
declare @tab table ( colA varchar(100 ) )
insert into @tab select 'this is a sentence'
insert into @tab select 'This is sql server'
insert into @tab select 'This is another sentence'

SELECT *
FROM @tab
WHERE colA Like '%Sentence%'
0
 
lapuccaAuthor Commented:
I'm using ms sql 2005
0
 
SQL_SERVER_DBAConnect With a Mentor Commented:
select columnA from table where PATINDEX('%sentense%', columnA) > 1

0
 
lapuccaAuthor Commented:
Why wouldn't my query below work?  It retrives nothing when I can see records that qualify this query?

SELECT *
  FROM sr
inner join  a
on sr.Id = a.Result_id
where a.Value like '%sentence%'    
0
 
lapuccaAuthor Commented:
Oops,. sorry.  Typo is the problem.  
0
All Courses

From novice to tech pro — start learning today.