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.
SELECT RIGHT('000000' + CAST([ID] as SYSNAME), 8) ID FROM Table1
上面的查询使列右对齐并在 sql server 中填充左零。有人可以让我知道 Oracle DB 中的等价物吗?
SELECT LPAD(ID,8,'0') FROM Table1可能对你有用。
SELECT LPAD(ID,8,'0') FROM Table1
看看这个lpad 的用法