SQL 给字符串补0

               SELECT   STUFF('000000000', 9 - LEN(PTAT.PTAP_Count) + 1,
                              LEN(PTAT.PTAP_Count), PTAT.PTAP_Count)
               FROM     ( SELECT    COUNT(1) AS PTAP_Count
                          FROM      #Detail_PTAP
                        ) AS PTAT;

 

转载于:https://www.cnblogs.com/qiangshu/p/5216576.html

你可能感兴趣的:(SQL 给字符串补0)