这些方法是开发过程中用到的不单单是数据库中的比较杂,记下来以免忘记。
函数集: http://www.qqgb.com/DataDB/Oracle/OracleJiQiao/DataDB_63718_2.html
数据库导出:exp ****(用户名)/oracle(密码)@(数据库SID_IP) file=f:/aaa.dmp owner=****(用户名)
//在导入数据库前需建立用户和对应的表空间
数据库导入: imp userid=****(用户名)/oracle(密码)@(数据库SID_IP) file=f:/aaa.dmp full=y
dual用于查看结果: select to_char(sysdate,'yyyy') from dual;
日期差: select trunc(SYSDATE-TO_DATE('2009-10-01','YYYY-MM-DD')) from dual
月份差: select months_between(to_date('2097-02-28', 'YYYY-MM-DD'), to_date('1986-1-31', 'YYYY-MM-DD'))/12 from dual
生成序列号: CREATE SEQUENCE test1_sequence INCREMENT BY 1 MINVALUE 1000 MAXVALUE 9999
删除序列号:drop sequence test1_sequence
新增字段及注释: alter table cb21 add BCB200 VARCHAR2(10);COMMENT ON COLUMN cb21.bcb200 IS '注释更新';
修改字段长度:alter table ccy2 modify (BCCY73 VARCHAR2(40))
更新字段内容: update sc08 set bsc017='/aaa/aa01Action.do?method=enter&'||'menuId='||'queryinfo'
查看建表时间:SELECT * FROM ALL_OBJECTS WHERE OBJECT_NAME='AC90';
查询表名及表说明(comment):select * From user_tab_comments
查询表及表中字段的说明:select * from user_col_comments
decode函数:select decode(sign('2'-'2'),1,'√','×') from dual
union用法:SELECT column_name(s) FROM table_name1 UNION SELECT column_name(s) FROM table_name2
判断语句:select case when to_date('2008-05-01','yyyy-MM-dd')>=to_date('2008-03-01','yyyy-MM-dd') then to_date('2008-05-01','yyyy-MM-dd') else to_date('2008-03-01','yyyy-MM-dd') end from dual
--java
时间字符串分解:String todayStr = DateUtil.convertDateToYearMonthDay(DateUtil.getDate());
<%=todayStr.substring(0,4) %>年<%=todayStr.substring(4,6) %>月<%=todayStr.substring(6,8) %>日
转换年月字符串为数字:Integer.parseInt(todayStr.substring(1, 4))*12+ Integer.parseInt(todayStr.substring(4));
保留2位小数: DecimalFormat df =new DecimalFormat("#.00");System.out.println(df.format(a));
--js
获取当前日期的yyyy-mm-dd: var s=""; var theDate=new Date();s+=theDate.getYear()+"-";s+=(theDate.getMonth()+1)+"-";s+=theDate.getDate();
tomcat 编码-中文:URIEncoding="GBK"