SELECT alertid,
ackuid,
severity,
ticketid,
From_unixtime(display_ts) AS Detection_Time,
From_unixtime(ack_ts) AS Ack_Time,
Round(( ack_ts - display_ts ) / 60) AS MTTA_MINS,
IF (Round(( ack_ts - display_ts ) / 60) > 15, 1, 0) AS SLA_MISSED
FROM alerts_test
WHERE display_ts > Unix_timestamp(Now() - INTERVAL 26 day)
ORDER BY From_unixtime(display_ts);
ERROR 1690 (22003): BIGINT UNSIGNED value is out of range in '(
dba
.DBA_IRIS_ALERTS
.ack_ts
-dba
.DBA_IRIS_ALERTS
.display_ts
)'
How to resolve this error? Especially in this condition it is failing.
round((ack_ts-display_ts)/60) as MTTA_MINS,
IF ( round((ack_ts-display_ts)/60) > 15, 1, 0) as SLA_MISSED
Sample Data
+----------------------------------+-----------------+----------+-------------+---------------------+---------------------+-----------+------------+
| alertid | ackuid | severity | ticketid | Detection_Time | Ack_Time | MTTA_MINS | SLA_MISSED |
+----------------------------------+-----------------+----------+-------------+---------------------+---------------------+-----------+------------+
| xxxxxx | him | 5 | NULL | 2018-11-01 00:03:23 | 2018-11-01 00:06:18 | 3 | 0 |
| xxxxxx | him | 5 | NULL | 2018-11-01 00:11:08 | 2018-11-01 00:17:45 | 7 | 0 |