如何将这些数字列(timestamp、event_dt)转换为日期或时间掩码?我正在尝试这个:
select to_char(timestamp,'YYYY-MON-DD HH24:MI:SS'), domain_c, to_char(event_date,'YYYY-MON-DD HH24:MI:SS'), total_reads from TOP_READ_EVENTS where timestamp= to_char(sysdate-2,'yyyymmdd') || '0000'
*
ERROR at line 1:
ORA-01481: invalid number format model
SQL> desc top_read_events;
Name Null? Type
----------------------------------------- -------- ----------------------------
YEAR NUMBER
QUARTER NUMBER
MONTH NUMBER
DAY NUMBER
HOUR NUMBER
TIMESTAMP NUMBER
DOMAIN_C VARCHAR2(255)
EVENT_DT NUMBER
TOTAL_READS NUMBER
select timestamp, domain_c, event_dt, total_reads from TOP_READ_EVENTS where timestamp= to_char(sysdate-2,'yyyymmdd') || '0000'
TIMESTAMP DOMAIN_C EVENT_DT TOTAL_READS
---------- ------------------------------ ------------ -------------
2.0111E+11 b.e.att-mail.com 2.0111E+11 14406
2.0111E+11 bounce.emailinfo2.bestbuy.com 2.0111E+11 14156
2.0111E+11 bounce.bluestatedigital.com 2.0111E+11 13701
2.0111E+11 plentyoffish.com 2.0111E+11 13384
2.0111E+11 mail.classmates.com 2.0111E+11 13281
2.0111E+11 comcast.net 2.0111E+11 13241
2.0111E+11 uniquelistsmail.com 2.0111E+11 13135
2.0111E+11 tankgorilla.com 2.0111E+11 12835
2.0111E+11 frigidphoenix.com 2.0111E+11 12657