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.
我有一个像上面那样的时间序列数据。T0,T1,... 代表工单提交到第 1 阶段、第 2 阶段等的日期。我需要做的就是找出每个阶段花费的时间,前提是遵循所有阶段不是强制性的(即一张票可以直接从第1阶段移动到第3阶段,然后T2中的日期将留空)。我需要在 Aster Teradata 中找到结果。
如果您想要 stage_n 和下一个 NOT NULL 阶段之间的区别:
LEAST(T1,T2,T3,T4,T5) - T0 AS stage_0, LEAST(T2,T3,T4,T5) - T1 AS stage_1, LEAST(T3,T4,T5) - T2 AS stage_2, LEAST(T4,T5) - T3 AS stage_3, T5 - T4 AS stage_4,