oracle 函数大全
1、SQL 语句基础
下面给出SQL语句的基本介绍。
1.1、SQL语句所用符号
操作符
用途
例子
+ -
表示正数或负数,正数可省去 +
-1234.56
+
将两个数或表达式进行相加
A=c+b
-
将两个数或表达式进行相减
34-12
*
将两个数或表达式进行相乘
12*34
/
除以一个数或表达式
18*11
NULL
空值判断
Where name is null;
||
字符串连接
‘101-’||tel_num
=
等于测试
Select * from emp where name=’赵元杰’;
!= 或<>或^=
不等于测试
Select * from emp where name !=’赵元杰’;
<
小于测试
Select * from emp where sal < 5000;
>
大于测试
Select * from emp where sal > 5000;
<=
小于等于测试
Select * from emp where sal <= 5000;
>=
大于等于测试
Select * from emp where sal >= 5000;
Not in
测试某值是否在一个指定的结果集中
Select name,addr from expert where local not in(‘北京’,’上海’);
ANY
将一个值与一组值进行比较,返回满足条件的结果。必须跟!=,<,>,<=,>=
select ename,sal from emp where sal<= any(select sal from emp where deptno=10)
SOME
同ANY,必须跟!=,<,>,<=,>=
ALL
将一个值与一组值比较,返回满足条件的所有列值。必须跟!=,<,>,<=,>=
Select name,sal from emp w here sal<= all
( 500,800,1200);
Not between
A and B
判断某个值是否界于两者之间。
Select name,sal from emp Where
sal between 500 and 1200;
[not]exists
判断某个列是否存在于一组值中。
select dname,deptno from dept where exists
(select * from emp where dept.deptno=emp.deptno)
A[not]like b
比较两个模式是否相
相关文档:
只是sqlserver 提供的远程数据访问函数; 在本地sqlserver 中取外部数据源数据时候可用;
对连接本地 oracle 操作远程 oracle 不能使用; 测试: pl/sql 中使用:
select * from openrowset(................); 无效!!!!!!!!!!!!!!
在oracle 中需要访问远程数据,需要建立一连接远程oracle 的 dblink ;
再用如下方 ......
【转】http://www.gbunix.com/htmldata/2004_06/2/5/article_53_1.html
oracle系统表查询【GBUnix】
数据字典dict总是属于Oracle用户sys的。
1、用户:
select username from dba_users;
改口令
alter user spgroup identified by spgtest;
2、表空间:
select * fro ......
oracle10g创建用户
Oracle10g 的创建用户名
1、 linux 下 oracle 的启动
以 oracle 身份登录
启动 lsnrctl start
登录 sqplus /nolog
连接数据库 connect /as sysdba
启动数据库 startup
关闭数据库 s ......
select * from (select t.*,rownum rn from (select * from emp) t where rownum<=10) where rn>=6;
创建分页结果集的游标
create or replace package fenyepackage as
type testcursor is ref cursor;
end fenyepackage;
创建分页存储过程
create or replace procedure fenye3(
tableName varchar2, --表名
......
在ORACLE中给表、列增加注释以及读取注释
1、给表填加注释:SQL>comment on table 表名 is '表注释";
2、给列加注释:SQL>comment on column 表.列 is '列注释';
3、读取表注释:SQL>select * from user_tab_comments where comments is not null;
4、读取列注释:SQL>select * from user_col_commnents wh ......