We help IT Professionals succeed at work.

Replace in T-SQL

johnywhite
johnywhite asked
on
I have a column named "Chain" in this this column has multiple values each seperated by a comma. Is there any way to remove or replace the last value, ie anything after the last comma.
Comment
Watch Question

Commented:
SUBSTRING(Status, 1, LEN(Status) - CHARINDEX(',', REVERSE(Status)))


123,456,789

the output will be 123,456

Commented:
status being a field that i tested with :)

Author

Commented:
Thanks

Explore More ContentExplore courses, solutions, and other research materials related to this topic.