i have a query which gets a time difference from two timestamps, which basically looks like this
SELECT (time_a - time_b) FROM t_tabel WHERE t_some_id IN('1','2','3');
then I get the output
0 0:4:0.0
1 0:15:0.0
0 0:20:0.0
DAYS HOURS24H:MINUTES:SECONDS:MILLISECONDS
Now I just want to sum up these times, I've tried several things but nothing wont work.
SELECT sum(time_a - time_b) FROM t_tabel WHERE t_some_id IN('1','2','3');
gives me: inconsistent datatypes: expected NUMBER got INTERVAL DAY TO SECOND
SELECT sum(to_dsinterval(time_a - time_b)) FROM t_tabel
WHERE t_some_id IN('1','2','3');
gives me: inconsistent datatypes: expected NUMBER got INTERVAL DAY TO SECOND
SELECT sum(SELECT time_a - time_b FROM t_tabel
WHERE t_some_id IN('1','2','3')) from dual;
gives me: missing expression
SELECT sum(SELECT to_dsinterval(time_a - time_b) FROM t_tabel
WHERE t_some_id IN('1','2','3')) from dual;
gives me: missing expression
Somehow it's got to work.