Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

SQL QUERY

Posted on 2009-05-06
5
Medium Priority
?
221 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 1200 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 800 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

TCP/IP Network Protocol Cheat Sheet

TCP/IP is a set of network protocols which is best known for connecting the machines that make up the Internet. The truth is that TCP/IP is one of the oldest network protocols and its survival is mainly based on its simplicity and universality.

Question has a verified solution.

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

In database programming, custom sort order seems to be necessary quite often, at least in my experience and time here at EE. Within the realm of custom sorting is the sorting of numbers and text independently (i.e., treating the numbers as number…
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.…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

688 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