質問

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.

役に立ちましたか?

解決

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

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top