Solved

SQL QUERY

Posted on 2009-05-06
5
172 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
  • 3
5 Comments
 

Author Comment

by:lapucca
Comment Utility
I'm using ms sql 2005
0
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 300 total points
Comment Utility
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
Comment Utility
select columnA from table where PATINDEX('%sentense%', columnA) > 1

0
 

Author Comment

by:lapucca
Comment Utility
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
Comment Utility
Oops,. sorry.  Typo is the problem.  
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Introduction Hopefully the following mnemonic and, ultimately, the acronym it represents is common place to all those reading: Please Excuse My Dear Aunt Sally (PEMDAS). Briefly, though, PEMDAS is used to signify the order of operations (http://en.…
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.​
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

743 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now