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
 Query for duplicate characters?

Author  Topic 

kelemvor
Starting Member

6 Posts

Posted - 2011-05-17 : 12:51:57
Howdy,

Not sure if this is possible but here's my issue. We have some data that comes up with some repeating characters every now and then. E.g. we might have a field with ....text or ,,,,text or something like that.

Is there a way to run a select statement to somehow check if the first two characters in a field are the same? Doesn't matter what they are, just to see if they are the same or not?

Thanks.

X002548
Not Just a Number

15586 Posts

Posted - 2011-05-17 : 12:56:49
would you care to post some sample data in the form of DML

Like

SELECT 'Data' UNION ALL
SELECT 'more Data' UNION ALL
ect

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2011-05-18 : 01:53:00
This?

select * from table where left(YourColumn,1) = right(left(YourColumn,2),1)


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -