日期:2014-05-16  浏览次数:20583 次

Oracle 小技巧
Oracle 时间long型计算
-----
select (to_date('2010-09-11 0:0:0', 'YYYY-MM-DD HH24:MI:SS')+7-TO_DATE('1970-01-01 8:0:0', 'YYYY-MM-DD HH24:MI:SS'))*24*60*60*1000 from dual;

Oracle 排重
排重的字段可以依次类推
------
delete from table_1 a
where a.rowid !=
(
select max(b.rowid) from table_1 b
where a.field_a = b.field_a and
a.field_b = b.field_b
)

查找index.
----
SELECT * FROM all_ind_columns WHERE table_name = 'table_name';