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.
Author |
Topic |
doanminhchau
Starting Member
9 Posts |
Posted - 2012-02-13 : 02:44:31
|
I have some strings including 10 characters in the same column and I want to check every string with the condition like: the sixth, the eighth and the tenth characters are the same, e.g:0123467696.I have an issue with this SQL query and I tried to write an stored procedure but I didn't succeed, please any one can help me.Thanks for any answer. |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2012-02-13 : 03:07:56
|
substring() No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
doanminhchau
Starting Member
9 Posts |
Posted - 2012-02-13 : 03:33:25
|
thank for your answer, webfred, could you elaborate you idea, substring()is a function help to get a string but it don't know exactly the position of the character.Thanks |
 |
|
senthil_nagore
Master Smack Fu Yak Hacker
1007 Posts |
Posted - 2012-02-13 : 03:44:15
|
Select * from <table_name> where substring('0123467696',6,1)=6 andsubstring('0123467696',8,1)=6 and substring('0123467696',10,1)=6Senthil Kumar C------------------------------------------------------MCITP - Database Administration SQL SERVER 2008MCTS - Database Development SQL SERVER 2008 |
 |
|
doanminhchau
Starting Member
9 Posts |
Posted - 2012-02-13 : 04:25:48
|
I have already done this, Thanks for your help, have a nice dayThanks again |
 |
|
|
|
|
|
|