开发者

Display one character give number of times

I have a table like this:

Display one character give number of times

I need to add a character "A" incremented number of times to the end of stor_Id if qty <=90开发者_如何学JAVA.

So after returning a query I should get Something like:

Stor_Id  
7131  
7066  
7067a  
8042aa  
7896aaa  
6380aaaa  

Thanks!


Assuming Rank is also an incrementing number. If not then I'm not sure how to have a number increment for each row your operating on.

Something like this should work (not tested, but should be almost there)

UPDATE U
SET stor_Id = stor_Id + REPLICATE('A',rank)
FROM MyTable AS U
WHERE qty <= 90
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜