November 10, 2015 at 1:05 am
Search from a column where values contains once space and after then any character other than space, but did not delete those who has two or more than 2 spaces continuous.
November 10, 2015 at 6:35 am
It's going to be a bit slow but something like the following will do it...
SELECT columnlist
FROM dbo.SomeTable
WHERE (SomeColumn LIKE '%[^ ] [^ ]%' OR SomeColumn LIKE ' [^ ]%')
AND SomeColumn NOT LIKE '% %'
;
Seems like homework though... you need to be able to explain it. Lookup "LIKE" in Books Online. If you don't know what "Books Online for SQL Server" is, you might want to spend some time on that, as well.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply