随笔分类 -  database

数据库
摘要:select extract(day from inter) * 24 * 60 * 60 + extract(hour from inter) * 60 * 60 + extract(minute from inter) * 60 + extract(second from inter) "seconds" from (select to_times... 阅读全文
posted @ 2016-09-05 18:28 Earic 编辑
摘要:1.months_between(date1,date2);date1和date2相减得到相差的月份。 select months_between(to_date('2015-05-11','yyyy-MM-dd'),to_date('2015-04-11','yyyy-MM-dd')) from dual ;相差一个月。 2.ceil(date1-date2);date1-date2... 阅读全文
posted @ 2016-09-05 17:52 Earic 编辑
摘要:如果你是使用PL/sql工具,在command 窗口下执行set serveroutput on 然后exec sp;可以看到了或者在sqlplus 中执行上面的代码 阅读全文
posted @ 2016-08-02 07:29 Earic 编辑
摘要:QRTZ_CALENDARS 存储Quartz的Calendar信息QRTZ_CRON_TRIGGERS 存储CronTrigger,包括Cron表达式和时区信息QRTZ_FIRED_TRIGGERS 存储与已触发的Trigger相关的状态信息,以及相联Job的执行信息QRTZ_PAUSED_TRI 阅读全文
posted @ 2016-08-02 07:28 Earic 编辑
摘要:SELECT sysdate,sysdate-30/(24*60) FROM dual; 30分钟或者自定义 阅读全文
posted @ 2016-07-01 09:34 Earic 编辑
摘要:SELECT obj# FROM obj$ AS OF TIMESTAMP TO_TIMESTAMP('2016-06-30', 'YYYY-MM-DD') WHERE NAME = 'PFWZ_APPLICATION_OPERATION'; 87842 87852 SELECT source FROM source$ AS OF TIMESTAMP TO_TIMESTAMP('2016-06... 阅读全文
posted @ 2016-06-30 11:02 Earic 编辑
摘要:创建目录 create or replace directory exp_dir as '/tmp'; 赋权 grant read, write on directory exp_dir to PUBLIC; 测试写文件 declare fhandle utl_file.file_type; begin fhandle := utl_file.... 阅读全文
posted @ 2016-06-30 10:12 Earic 编辑
摘要:set heading offset line 40001.设置页面显示总行数show pagesize; //首先查看目前的pagesize,默认是14set pagesize 100; //将pagesize设置好100,则可以一次显示够多行记录了2.设置行的宽度show linesize; / 阅读全文
posted @ 2016-06-15 13:07 Earic 编辑
摘要:检查状态select saddr,sid,serial#,paddr,username,status from v$session where username is not null查询用户的连接状态Select username,sid,serial# from v$session where 阅读全文
posted @ 2016-06-14 19:03 Earic 编辑
摘要:MySQL 的官网下载地址:http://www.mysql.com/downloads/ 在这个下载界面会有几个版本的选择。 1. MySQL Community Server 社区版本,开源免费,但不提供官方技术支持。 2. MySQL Enterprise Edition 企业版本,需付费,可以试用30天。 3. MySQL Cluster 集群版,开源免费。可将几个MySQL Serv... 阅读全文
posted @ 2016-06-08 17:54 Earic 编辑
摘要:select * from meta_hdfs_info_bak where not exists (select 1 from meta_hdfs_info where meta_hdfs_info.hdfsPath=meta_hdfs_info_bak.hdfsPath AND meta_hdfs_info.clusterUserId=meta_hdfs_info_bak.cluster... 阅读全文
posted @ 2016-04-26 15:41 Earic 编辑
摘要:@Options(flushCache = true, timeout = 20000) 阅读全文
posted @ 2016-04-19 14:21 Earic 编辑
摘要:由于删除了某些记录行,所以自增字段不连续了。重排或归零的方法:方法1:truncate table 你的表名//这样不但重新定位自增的字段,而且会将表里的数据全部删除,慎用!方法2:delete from 你的表名dbcc checkident(你的表名,reseed,0) //重新定位自增的字段, 阅读全文
posted @ 2016-03-25 09:49 Earic 编辑
只有注册用户登录后才能阅读该文。
posted @ 2016-03-17 21:05 Earic 编辑
摘要:SELECT * from mconsumeinfo mo where CONVERT(Datetime, mo.financedate, 120)> dateadd(day,-180,getdate()) 阅读全文
posted @ 2015-11-19 14:39 Earic 编辑
摘要:DECLARE @BJ GEOGRAPHY DECLARE @XT GEOGRAPHY SELECT @BJ= geography::Point('39.92889', '116.38833', 4326) SELECT @XT = geography::Point('37.0630556', '... 阅读全文
posted @ 2015-10-30 14:06 Earic 编辑
摘要:SELECT id, name, staffopenid, imageurl, content, ordernum, praisenum, createdate, lable, label2, managenoFROM ( ... 阅读全文
posted @ 2015-10-29 17:46 Earic 编辑
只有注册用户登录后才能阅读该文。
posted @ 2015-10-07 14:35 Earic 编辑
摘要:1、针对大数据量的,避免使用 or 操作select*from user_info where username like ‘yue%’ or username like '%yue'可优化成:select*from user_info where username like ‘yue%’ unio... 阅读全文
posted @ 2015-10-07 14:34 Earic 编辑