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 |
|
mightytater
Starting Member
3 Posts |
Posted - 2011-10-24 : 14:43:59
|
| Hey all, I have a non-normalized database supporting a legacy application, that displays text from a single column, column D. Column D is actually derived from column A ++ column B ++ column C. Occasionally, either column A or column C may have leading or trailing spaces.How can I SELECT * from MYTABLEWHERE COLUMN_C <> trim(trim(COLUMN_A ++ COLUMN_B) ++ COLUMN_C)Many thanks!Matt |
|
|
Lamprey
Master Smack Fu Yak Hacker
4614 Posts |
Posted - 2011-10-24 : 14:49:27
|
I'm not sure I understand your question 100%, but maybe this will help?SELECT * from MYTABLEWHERE COLUMN_C <> LTRIM(RTRIM(COLUMN_A)) + COLUMN_B + LTRIM(RTRIM(COLUMN_C)) |
 |
|
|
mightytater
Starting Member
3 Posts |
Posted - 2011-10-24 : 15:10:20
|
| Oh good grief, could it be that simple?Many thanks! |
 |
|
|
|
|
|