The following Microsoft SQL query compares two date fields of a table and returns those records for which the difference in minutes is greater than 5.
SELECT t.Id, t.date1, t.date2, DATEDIFF(MINUTE, t.date1 , t.date2) AS Mtime FROM table1 t WHERE DATEDIFF(MINUTE,t.date1, t.date2) > 5 I have no idea how to write this with ORACLE. I've searched for solution and the closest I came to was :
SELECT t.date1, t.date2, (t.date1 - t.date2) * 1440 AS Mtime FROM table1 t WHERE (t.date1 -t.date2) * 1440 > 5 which gives me the error inconsistent datatypes: expected INTERVAL DAY TO SECOND got NUMBER
Does anyone know how to write this query with ORACLE ?