Teradata - 时间戳差异 - 间隔字段溢出错误

时间:2017-02-01 00:18:02

标签: teradata

我试图减去两个TIMESTAMP字段,并希望在一分钟内得到差异。

SELECT EXTRACT(MINUTE FROM ( CAST(END_DT AS TIMESTAMP(0)) - CAST(START_DT AS TIMESTAMP(0)) MINUTE(4) TO SECOND)) + EXTRACT(SECOND FROM (CAST(END_DT AS TIMESTAMP(0)) - CAST(START_DT AS TIMESTAMP(0)) MINUTE(4) TO SECOND)) * 1.00 / 60 
from tableA

但我收到间隔提交溢出错误。

1 个答案:

答案 0 :(得分:0)

我可以使用下面的

来实现解决方案
.btn

其中 TIME_DIFF <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> </head> <body> <div id="years" class="btn-group btn-group-justified timeline"> <a href="#@DateTime.Now.Year" class="btn btn-primary">@DateTime.Now.Year</a> <br> <br> <a href="#@DateTime.Now.AddYears(-1).Year" class="btn btn-primary">@DateTime.Now.AddYears(-1).Year</a> <br> <br> <a href="#@DateTime.Now.AddYears(-2).Year" class="btn btn-primary">@DateTime.Now.AddYears(-2).Year</a> </div> <script> $("#years a").click(function(e) { console.log(this); e.preventDefault(); alert("click"); }); </script> </body> </html>