Let's Assume I have DataTable in Ms sql that represents simple matrix
Existing Table
ids_cloumn
========================
RX ,BX , AS , RX ,BX , AS
XR ,Xs , AS
XR ,Xs , AS,XR ,Xs , AS
RX ,BX , AS ,
RX ,BX , AS ,
I want to filter the duplicated data in string and data is separated by ' , '
ids_column
========================
RX ,BX , AS
XR ,Xs , AS
XR ,Xs , AS
RX ,BX , AS ,
RX ,BX , AS ,
right now i am using this But this approach is unsuccessful
declare @i int
declare @c char
declare @rst varchar(8000)
set @i=1
set @rst=substring(‘aaassrt’,1,1)
set @c=”
while @i<=len(‘aaassrt’)
begin
set @c=substring(‘aaassrt’,@i,1)
if charindex( @c,@rst,1)=0
set @rst=@rst+@c
set @i=@i+1
end
select @rst