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 |
|
shajimanjeri
Posting Yak Master
179 Posts |
Posted - 2008-04-12 : 04:12:55
|
| Hi all,I have a string like '10010000001000'.Here I need to find the 4th character of this string (in this case it should be '1') by using sql query. How to do this one?regardsShaji |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-04-12 : 04:16:18
|
| SELECT SUBSTRING('10010000001000',4,1) |
 |
|
|
raky
Aged Yak Warrior
767 Posts |
Posted - 2008-04-12 : 05:10:44
|
| SELECT RIGHT(LEFT('10010000001000',4),1) |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-04-12 : 05:13:12
|
quote: Originally posted by raky SELECT LEFT('10010000001000',1)
how will this give 4th character? this will always return the first character of string from the left. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-04-14 : 03:11:52
|
quote: Originally posted by visakh16
quote: Originally posted by raky SELECT LEFT('10010000001000',1)
how will this give 4th character? this will always return the first character of string from the left.
He has edited the reply MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|