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 |
yguyon
Starting Member
11 Posts |
Posted - 2015-01-14 : 15:07:39
|
I have this field in one of the column DBMP-1861571 and I would like to write a querry that only extract DBMP in a select statement... |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2015-01-14 : 15:15:29
|
select LEFT(columnname, 4) as aliasnamefrom your tableTara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |
|
|
yguyon
Starting Member
11 Posts |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2015-01-14 : 15:37:09
|
select left(columnname, charindex('-', columnname)-1) as aliasnamefrom yourtableTara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |
|
|
|
|
|