摘要:
PL/SQL语句以块为单位,块的基本结构为: declare 可选 ..变量 类型 begin 必选 .. exception 可选 .. end; 必选 / 语句块可以嵌套: DECLARE … 变量声明 x int; BEGIN --代码主体 … DECLARE --嵌套语句块 x int; … 阅读全文
posted @ 2020-01-05 16:57
marxist
阅读(280)
评论(0)
推荐(0)
摘要:
[oracle@dba ~]$ cat a.sh #!/bin/bash TAB=emp sqlplus -s scott/password << EOF | awk 'NR != 1 && $2 ~ /S.*T/{print $2,$6}' set head off set feed off se 阅读全文
posted @ 2020-01-05 02:10
marxist
阅读(256)
评论(0)
推荐(0)
摘要:
set linesize 200set term off verify off feedback off pagesize 999set markup html on entmap ON spool on preformat offspool tables.xlsselect * from renk 阅读全文
posted @ 2020-01-05 02:08
marxist
阅读(366)
评论(0)
推荐(0)
摘要:
Oracle正则表达式(regularexpression) 元字符 字符含义 举例说明 ^ 匹配字符串的开始位置(在[]中使用,此时它表示不接受该字符集合。 ^a:匹配以a开始的字符串 [^a]:匹配不含a的字符串 - 当使用在a-m表示范围; 当使用在第一个字符时表示 连字符串,如[-abc] 阅读全文
posted @ 2020-01-05 02:04
marxist
阅读(1032)
评论(0)
推荐(0)
摘要:
max()、min()、avg()、sum()、count() SQL> select deptno,ename,sal, sum(sal) over(partition by deptno order by deptno) sum_sal, round(avg(sal) over(partitio 阅读全文
posted @ 2020-01-05 01:35
marxist
阅读(664)
评论(0)
推荐(0)
摘要:
row_number 和伪列rownum类似,都是产生顺序的序列号的,但这个分析函数row_number并不是为整个select数据产生序列,而是为分组后的每个组内产生序列。 比如,要取出每个部分的前两个最高工资的员工 SQL> select deptno,ename,sal from (selec 阅读全文
posted @ 2020-01-05 00:55
marxist
阅读(626)
评论(0)
推荐(0)

浙公网安备 33010602011771号