Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Querying when an item has a single string

Author  Topic 

Rosembm1
Starting Member

15 Posts

Posted - 2011-06-29 : 07:26:59
Dear Gurus,

I have some data I need to query to identify records based on an object that have a single quote. I want to select the row that has the embedded quotes. This should return 2 rows, per the example below. Thanks!

Example:
ID MRN
1 111
2 '222
3 333
4 4'44



MWRosenblatt
Spins Yak

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2011-06-29 : 07:29:06
[code]select
ID,
MRN
from
YourTable
where
MRN like '%''%'[/code]
Go to Top of Page

Rosembm1
Starting Member

15 Posts

Posted - 2011-06-29 : 13:11:21
Thanks!

MWRosenblatt
Spins Yak
Go to Top of Page
   

- Advertisement -