Pergunta

I have a problem building a query in oracle. I have table with column "DATE_CREATE", which has a type of "TIMESTAMP". Example of one value is:

2012-10-20 05:43:47:001000

I would like to build a where clause for selecting rows with create column newer than 15 minutes ago. For now I have a query like this (which return no rows, but it should):

SELECT DATE_CREATE,ID
FROM TABLE
WHERE DATE_CREATE >= CURRENT_TIMESTAMP - interval '15' minute

Help please...

Foi útil?

Solução

Try this:

SELECT DATE_CREATE,ID
FROM TABLE
WHERE DATE_CREATE >= CURRENT_TIMESTAMP - NUMTODSINTERVAL(15, 'MINUTE')
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top