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 |
|
lemondash
Posting Yak Master
159 Posts |
Posted - 2012-05-18 : 06:24:42
|
| Hello All,I try to write a query on a field that will return where that field ony has one word.Thanks Lee |
|
|
ashishashish
Constraint Violating Yak Guru
408 Posts |
Posted - 2012-05-18 : 06:40:03
|
| You can use LEN(Yourcolumn)=1------------------------------------------------The answer is always no till than you don't ask. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2012-05-18 : 08:40:11
|
quote: Originally posted by ashishashish You can use LEN(Yourcolumn)=1------------------------------------------------The answer is always no till than you don't ask.
This will work for a word with only one letter. For one word with mulitple charactersWHERE len(col)-len(replace(ltrim(rtrim(col)),' ',''))=0MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|