Oracle中常用的函数
---sql的函数的使用(Oracle)
---dual的使用:哑元表:没有表需要查询的时候 可以用它
---select 'Hello World' from dual; ---结果:Hello World
---单行函数:单行
1.日期函数:系统时间:sysdate---select sysdate from dual; ---当前的系统时间---结果:2010-05-14
sysdate+(-)整数的含义---select sysdate+1 from dual; ---当前系统日期的后一天---结果:2010-05-15
---select sysdate-7 from dual; ---当前系统日期的上一周---结果:2010-05-07
日期间间隔的天数:日期1+(-)日期2---select (sysdate-hiredate) as 天数 from emp;
日期间间隔的月份:months_between(day1,day2):返回day1日期和day2日期之间相差的月份
---select months_between(sysdate,hiredate) as 月份 from emp;
to_char(day,'格式'):将一个数字或日期转换为字符串
---select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') from dual; ---结果:2010-05-14 18:49:07
---格式变化:---select to_char(sysdate,'d') from dual;---今天是这一周的第几天---结
相关文档:
http://gaoshan.blog.51cto.com/742525/284057
一、概述
从9.2版开始, Oracle公司设计实现了个别补丁"装管理工具opatch. opatch使用一个称为inventory的系统数据结构(严格说是与oui共享inventory), 集中管理所有已安装的个别补丁; 个别补丁的安装和卸载都使用opatch命令完成, 冲突检测也由opatch在安装时自动完成; 提供列 ......
第一种:
select b.* from
( select a.*, rownum row_num from
(select t.* from A05_ORGANIZATION t order by org_name_en asc) a
) b
where b.row_num between 1 and 5 order by b.row_num asc
第二种(更高效):
select b.* from
( select a.*, rown ......
1、修改Oracle最大连接数的方法
a、以sysdba身份登陆PL/SQL 或者 Worksheet
b、查询目前连接数
show parameter processes;
c、更改系统连接数
alter system set processes=1000 scope=spfile;
......
1.创建过程
与其它的数据库系统一样,Oracle的存储过程是用PL/SQL语言编写的能完成一定处理功能的存储在数据库字典中的程序。
语法:
create [or replace] procedure procedure_name
[ (argment [ { in| in out }] type,
argment [ { in | out | in out } ] type
{ is | as }
<类型 ......
SELECT sde.st_area(zone) from sde.test1 ORDER BY name;//
SELECT shape from schools ORDER BY name;
SELECT objectid, sde.st_astext(SDE.ST_POINTfromSHAPE(shape,0)) AS points from schools;
SELECT name, sde.st_x (zone) "The X coordinate" from test ; //正确执行
SELECT name, sde.st_x (shape) "The ......