Home:ALL Converter>Oracle query to get Data from table inserted in last 10 mins

Oracle query to get Data from table inserted in last 10 mins

Ask Time:2009-05-21T04:22:55         Author:RBS

Json Formatter

I have to get data from Oracle Table in which I have one datefield called lastupdatedDate and I want to get only that rows back in which lastupdatedDate is in last 10 mins of sysdate

For example, if in my table I have lastupdateDate as 05/20/09 4:20:44 then I want this row back in my result if I run the query in between 05/20/09 4:20:44 and 05/20/09 4:30:44, and not if if I run the query at 05/20/09 5:31:44.

Author:RBS,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/890035/oracle-query-to-get-data-from-table-inserted-in-last-10-mins
D'Arcy Rittich :

select *\nfrom mytable\nwhere lastupdatedDate > sysdate - interval '10' minute\n",
2009-05-20T20:28:33
Rob van Wijk :

Or slightly more readable:\n\nselect *\n from mytable\n where lastupdatedDate > sysdate - interval '10' minute\n",
2009-05-21T15:57:50
yy