time_created and time_ended are VARCHAR fields.
SQL statement
SELECT time_created,
time_ended,
TO_TIMESTAMP (time_ended, 'YYYY/MM/DD-HH24:MI:SS:FF9')
- TO_TIMESTAMP (time_created, 'YYYY/MM/DD-HH24:MI:SS:FF9')
FROM trans
output
2012/10/28-18:46:13.855 2012/10/28-18:47:43.357 +00 00:01:29.502000
2012/10/20-22:40:10.363 2012/10/20-22:40:35.265 +00 00:00:24.902000
2012/10/20-22:40:08.951 2012/10/20-22:40:24.717 +00 00:00:15.766000
2012/10/20-22:40:09.454 2012/10/20-22:40:28.217 +00 00:00:18.763000
2012/10/20-22:40:09.912 2012/10/20-22:40:31.767 +00 00:00:21.855000
2012/10/22-10:11:29.360 2012/10/22-10:14:08.692 +00 00:02:39.332000
2012/10/22-10:11:08.335 2012/10/22-10:11:43.781 +00 00:00:35.446000
2012/10/20-22:40:07.900 2012/10/20-22:40:17.508 +00 00:00:09.608000
2012/10/20-22:40:08.469 2012/10/20-22:40:21.144 +00 00:00:12.675000
2012/10/22-11:00:42.355 2012/10/22-11:01:41.706 +00 00:00:59.351000
2012/10/22-10:11:09.268 2012/10/22-10:11:54.185 +00 00:00:44.917000
2012/10/22-10:11:13.072 2012/10/22-10:12:21.365 +00 00:01:08.293000
I wish where clause which shows me only records greater than 1 minute.
I use Oracle Database 10g on Sun Solaris.
If you alias the difference column, you can wrap this in an outer select and just add a
whereclause:With dummy data to match your output, populated in a CTE: