Pergunta

Possible Duplicate:
Convert Unixtime to Datetime SQL (Oracle)

We have a table of type bigint. I try to run the following query:

select TO_CHAR(TO_TIMESTAMP(t.bigint_field / 1000), 'DD/MM/YYYY HH24:MI:SS') 
   from table t

and get this error

ORA-00932: inconsistent datatypes: expected - got NUMBER

I've looked at this question but still I am unnable to get rid of this error. Here is one value which I was using - 1340809355000.

Foi útil?

Solução

Try, select to_date('1970-01-01','yyyy-mm-dd') + t.bigint_field/24/60/60/1000 from table t

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top