Quantcast
Viewing all articles
Browse latest Browse all 5

T-SQL Question

create table test (id int, col varchar(10))
insert into test values (1,'a*b*c*'),(2,'a*b'),(3,'*b*c*d')

select col+ replicate('*',5-(len(col)-len(replace(col,'*',''))) ) from test

drop table test


Viewing all articles
Browse latest Browse all 5

Trending Articles