select empid, replicate('0', 6 - len(salary)) + cast (salary as varchar) as salary from emp; empid salary ----------- ----------- 1 000300 2 000030 3 500000 4 001000 (4 row(s) affected)
No comments:
Post a Comment