0 votes
33 views

I have some items in sql table like below :

2 21 65 54

How can i select items such that i get output as :

0002 0021 0065 0054

Can anyone help me with query ?

asked Aug 9, 2016 in Computer Science - IT by ppk (434 points) | 33 views

1 Answer

0 votes
Best answer

SELECT  RIGHT('0000' + CAST(productCode AS VARCHAR(7)), 4) Pcode FROM tbl_Product


answered Aug 9, 2016 by ppk (434 points)
selected Aug 10, 2016 by ppk