![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
日常sql pl/sql
ForKing_
这个作者很懒,什么都没留下…
展开
-
查看自己trace出来的文件路径
column trace new_val TRACE select c.value || '/' || d.instance_name || '_ora_' || a.spid || '.trc' trace from v$process a, v$session b, v$parameter c, v$instance d where a.addr = b.paddr and b.原创 2013-08-22 19:27:53 · 1365 阅读 · 0 评论 -
关于分析函数的例子
今天在群里看到有人问了一个sql问题。表结构如下 wsx@ORCL> select * from t_client; A B --- ------------------- a 2013-08-16:16:25:21 a 2013-08-16:16:25:24 a 2013-08-16:16:25:24 b 2013-08-16:16:25:28 b 2013-08-1原创 2013-08-23 20:59:24 · 491 阅读 · 0 评论 -
查看最近用户使用过的sql语句
1 select /* recetsql */ sql_id,child_number,hash_value,address,executions,sql_text 2 from v$sql 3 where parsing_user_id =(select user_id from all_users 4 where username=upper('&uname')) 5原创 2013-09-13 13:39:37 · 600 阅读 · 0 评论 -
查看哪些列上建了索引
hr@ORCL> column column_name format a22 heading 'Column Name' hr@ORCL> column index_name heading 'Index Name' hr@ORCL> column column_position format 999999999 heading 'Pos#' hr@ORCL> column descend for原创 2013-09-14 10:29:05 · 587 阅读 · 0 评论 -
connect by 的简单应用
一、首先从一个经典的查询序列数例子入手: select level from dual connect by level select level from dual connect by 1 = 1 上例均可查询得到1 .. N 的序列 我们来分析一下其工作原理,level with x as原创 2013-09-29 21:42:30 · 487 阅读 · 0 评论 -
oracle pivot and unpivot
pivot We will begin with the new PIVOT operation. Most developers will be familiar with pivoting data: it is where multiple rows are aggregated and transposed into columns, with each column represe转载 2013-10-12 11:24:00 · 1206 阅读 · 0 评论 -
存储过程写的oracle 分页查询
先创建一个游标类型 create or replace package p_page is type refCursorType is REF CURSOR; --游标类型定义,用于返回数据 end p_page;存储过程如下 CREATE OR REPLACE PROCEDURE proc_pageview(p_pagesize INT, p_pageno INT ,--当前页码 从1原创 2013-11-19 10:23:56 · 822 阅读 · 0 评论