在做一个功能的时候,需要在oracle数据库中查询指定某一天的数据. 如果是简单的当前日期前后几天,也好办 AND TO_CHAR(Rct.Creation_Date, 'YYYY-MM-DD')=to_char(sysdate-1,'yyyy-MM-dd') 即可 但是指定日期就不好弄了 可以这样做 select * from test1 t where t.end_datebetween to_date('2014-10-24 00:00:00','yyyy-mm-dd hh24:mi:ss
设置oracle中date的会话格式为 'yyyy-mm-dd hh24:mi:ss' alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss'; 设置oracle中timestamp的会话格式为 ‘yyyy-mm-dd hh24.mi.ss.ff’ alter session set nls_timestamp_format='yyyy-mm-dd hh24.mi.ss.ff'; c#中向oracle中插入date 可以直接操作日期数据
查锁表 select LOCK_INFO.OWNER || '.' || LOCK_INFO.OBJ_NAME as OBJ_NAME, -- 对象名称(已经被锁住) LOCK_INFO.SUBOBJ_NAME as SUBOBJ_NAME, -- 子对象名称(已经被锁住) SESS_INFO.MACHINE as MACHINE, -- 机器名称 LOCK_INFO.SESSION_ID as SESSION_ID, -- 会话SESSION_ID SESS_INFO.SERIAL# as S
查每张表中有多少条记录 SELECT table_name,num_rows FROM user_tables order by num_rows desc; https://www.cnblogs.com/xzhg/p/6473011.html 查一张表中不同时间段分别有多少条记录: select ttime, count(ttime) from VOLTE_GT_CELL_ANA_BASEDAY group by ttime; select ttime,count(ttime) from V
-- 查找重复记录select names,num from test where rowid != (select max(rowid) from test b where b.names = test.names and b.num = test.num) 或者使用 select names,num from test where rownum!= (select max(rownum