Solved

SQL QUERY

Posted on 2009-05-06
5
214 Views
Last Modified: 2012-05-06
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.
0
Comment
Question by:lapucca
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 

Author Comment

by:lapucca
ID: 24317812
I'm using ms sql 2005
0
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 300 total points
ID: 24317896
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
 
LVL 16

Assisted Solution

by:SQL_SERVER_DBA
SQL_SERVER_DBA earned 200 total points
ID: 24317898
select columnA from table where PATINDEX('%sentense%', columnA) > 1

0
 

Author Comment

by:lapucca
ID: 24317924
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
 

Author Comment

by:lapucca
ID: 24318032
Oops,. sorry.  Typo is the problem.  
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question