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 |
|
mdhingra01
Posting Yak Master
179 Posts |
Posted - 2005-01-12 : 14:13:36
|
| Is there a way to query a field to determine the unique charcters in that given field.For example:COLUMN1applebatcarThe query should returnaplebtcrThanks |
|
|
mdhingra01
Posting Yak Master
179 Posts |
Posted - 2005-01-12 : 14:40:34
|
| I found this example works for what I am doing. Feel free to replace the sysobjects table with aonther if you need more than 135 in your numbers table.use northwindgocreate table t (colA varchar(25))insert into t values('apple')insert into t values('bat')insert into t values('car')select top 25 identity(int, 1, 1) as numberinto numberfrom sysobjectsselect distinct substring(t.colA, number, 1)from t cross join number as nwhere substring(t.colA, number, 1) > ''drop table t, numbergo |
 |
|
|
|
|
|