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 |
|
DENIZ3E
Yak Posting Veteran
56 Posts |
Posted - 2006-01-30 : 10:14:25
|
| hý,ID code--- -----1 '01.01.'2 '01.'3 '01.04.05..'returns-------ID COUNT(.)=how many "." in the colomn--- -------- 1 22 13 4 |
|
|
Srinika
Master Smack Fu Yak Hacker
1378 Posts |
Posted - 2006-01-30 : 10:28:53
|
| Using String Functions as Charindex / substring u can write ur own function to give the No of specific characters in a string.or use the Point 16 of the following linkhttp://weblogs.sqlteam.com/mladenp/archive/2005/08/01/7421.aspxto write ur functionThen call that Function as Select ID, MyFunc(code) from MyTbl |
 |
|
|
VIG
Yak Posting Veteran
86 Posts |
Posted - 2006-01-30 : 17:17:28
|
| select id,len(s)-len(replace(s,'.',''))from(select 1 id , '01.01.' s unionselect 2 ,'01.' unionselect 3 ,'01.04.05..') a |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-01-31 : 01:28:14
|
| VIG's is the effecient way to goMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|