Substract two timestamps and get result in days, hours, minutes
I want to create a view as result substract two timestamps in days, hours, minutes and multiple column_names. As test I made a query like this :
select id, formingline, mouldnr, (CAST(stoptime as timestamp) - CAST(starttime as timestamp)) as diff from slr_logmould;
Then I make this query :
select extract (Day from diff) As Days, extract (Hour from diff) As Hours, extract (Minute from diff) As Minutes from (select id, formingline, mouldnr, (CAST(stoptime as timestamp) - CAST(starttime as timestamp)) as diff from slr_logmould);
Result :
Could somebody give me advice, what i do wrong, because I want the result include with the other column names.