Oracle完全手册 一:SQL&PL/SQL 二:Oracle 架构体系 三:备份与恢复 四:性能调整 五:Oracle 网络 六:OS相关 [Q]怎么样实现分组取前N条记录 [A]8i以上版本,利用分析函数 如获取每个部门薪水前三名的员工或每个班成绩前三名的学生。 Select * from (select depno,ename,sal,row_number() over (partition by depno order by sal desc) rn from emp) where
-- 首先,以超级管理员的身份登录oracle sqlplus sys/bjsxt as sysdba --然后,解除对scott用户的锁 alter user scott account unlock; --那么这个用户名就能使用了。 --(默认全局数据库名orcl) 1、select ename, sal * 12 from emp; --计算年薪 2、select 2*3 from dual; --计算一个比较纯的数据用dual表 3、select sysdate from dual;
pl/sal Create or replace trigger delete_student After delete on student For each row Begin Insert into backstudent values(:old.sno,:old.sname,:old.ssex,:old.sage,:old.sdept,:old.Birthday,sysdate); end delete_student; /
NULL
博文链接:https://hwhuang.iteye.com/blog/554177二一
RULES AND LIMITATIONS
Bind variables of a SQL statement are identified by their names.
When binding a value to a hind variable, the string identifying
the bind variable in the statement may optionally
概述
PL/SQL中的过程和函数(通常称为子程序)是PL/SQL块的一种特殊的类型,这种类型的子程序可以以编译的形式存放在数据库中,并为后续的程序块调用。
相同点: 完成特定功能的程序
不同点:是否用return语句返回值。
举个例子:
create or replace procedure PrintStudents(p_staffName in xgj_test.username%type) as
cursor c_testData is
select t.sal, t.com