Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
SQL データベースの列にゼロを追加したい。たとえば、データが 1 の場合は 001 を表示し、データが 11 の場合は 011 を表示する必要があり、データが 222 の場合は何もしない bcoz すでに 3 桁を完了しています...
SELECT RIGHT('000' + CAST(1 AS VARCHAR(3)), YourColumnNameHere) AS Value