Viewing 3 posts - 1 through 3 (of 3 total)
@test-2='Barton STREET'
select ltrim(rtrim(reverse(left(reverse(@test),charindex(' ',reverse(@test))))))
here @test-2 is your field.
I just wrote the logic. You can modify the result accordingly.
note: this logic works even if you have space...
June 18, 2003 at 12:38 pm
#461980
You can create a Temp table (as per your result set) and store the result from cusror into temp table. Select from temp table.
June 16, 2003 at 9:12 am
#461555
Another way is
SELECT
CASE WHEN col2 IS NULL THEN col1
ELSE col1+ ', ' +col2 END
FROM ....
June 12, 2003 at 4:54 pm
#461179