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.
如何在 DB2 中获取整数的子字符串?
示例:1023123 必须作为 1023 给出
看看VARCHAR和SUBSTR函数。你将使用这样的东西:
SUBSTR(VARCHAR(1023123), 1, 4)
编辑:根据您的评论,您还需要使用这些: CASE和LENGTH。