Quantcast
Viewing all articles
Browse latest Browse all 5

T-SQL Question

Could any one please answer my question:

I'm trying to write a query for adding extra '*' based on the count of "*'s in a column.

Ex:I have a data like this :

a*b*c*

a*b

a*b*c*d

I need 5 *'s  for each row. If the count is less than 5, I need to insert extra *'s to make it 5 for each row.

Output:

a*b*c***

a*b****

a*b*c*d**



Viewing all articles
Browse latest Browse all 5

Trending Articles