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 |
|
tpotter1968
Starting Member
1 Post |
Posted - 2009-06-26 : 23:58:54
|
| I have a column called "DataSource"Here are 3 examples of values from this column from 3 separate rows:img244.ad.tim.comimg244.ad.tim.com/testimg244.ad.tim.com/nameIf I do a select DISTINCT DataSource from tablename, obviously it will show all results above...what I need is one result specifying the servername portion and not the other data (the trailing slash and everything beyond it).Any ideas?ThanksI would need this to come back:img244.ad.tim.com |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2009-06-27 : 00:01:31
|
[code]select distinct left(DataSource, charindex('/', DataSource + '/') - 1)from tablename[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
|
|
|