易截截图软件、单文件、免安装、纯绿色、仅160KB

Oracle 实现行列转换

SQL> DESC TEST  测试表:        Name    Type            Nullable    Default Comments
       ----     ------------         --------      -------     --------
       A        NUMBER           Y                        
       B        VARCHAR2(20) Y          SQL> select * from test;                  A B
       ---------- --------------------
                 1 a
                 1 b
                 1 c
                 1 d
                 1 e
                 2 a
                 2 b
                 3 a
         


相关文档:

初学ORACLE 练习题

使用scott/tiger用户下的emp表和dept表完成下列练习,表的结构说明如下
  emp员工表(empno员工号/ename员工姓名/job工作/mgr上级编号/hiredate受雇日期/sal薪金/comm佣金/deptno部门编号)
  dept部门表(deptno部门编号/dname部门名称/loc地点)
  工资 = 薪金 + 佣金
  1.列出至少有一个员工的所有部门
   ......

oracle 一次删除多张表的数据(未测试版)

spool d:\deletetb.sql;
select 'delete ' || table_name || ' where to_char(col,'||'''yyyy'''||')='||'''2007'''||';'
  from user_tables
where table_name in  (select 'HS_' || lpad(rownum, '2', '0')
          from dual
        ......

oracle 表中插入多行

方法一:
SQL>create table aa(a number);
创建成功。
SQL> select * from aa;
A
--------
2
SQL>
SQL> insert all
2 into aa values(1)
3 into aa values(2)
4 select * from dual;
已创建2行。
SQL> commit;
提交完成。
SQL> select * from aa;
A
----------
2
1
2
方法二:
S ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号