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 Administration
 Parse the Character in SQL column

Author  Topic 

iamtheone
Starting Member

2 Posts

Posted - 2012-07-14 : 09:17:01

There is a column in SQL Table called security and it is a 10 bytes field.

Example:

Column Name : security
Data : YYNNYYYNNN

Can you help me out and write the SQL select statement that would parse out each character.

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2012-07-14 : 09:51:05
just use substring() to do it

example substring(security, 3, 2) will return 3rd and 4th char


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

iamtheone
Starting Member

2 Posts

Posted - 2012-07-15 : 11:44:21
Thanks Khtan.
Go to Top of Page
   

- Advertisement -