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.
我收到此代码的以下消息
case when substring(New_Limit,11,1)=' ' then '0'+substring(New_Limit,1,10)
'then' 位用于连接 0 和子字符串。有什么帮助吗?
这意味着您的New_Limit变量是一个数值。您可能想CAST在它周围放置一个 to (n)varchar。
New_Limit
CAST
您首先尝试将其转换为字符串类型(varchar):
SUBSTRING(CAST(New_Limit AS varchar(38)), 11, 1)