oracle行列转换
/*
在实际使用sql工作中总会碰到将某一列的值放到标题中显示.就是总说的行列转换或者互换.
比如有如下数据:
ID NAME KECHENG CHENGJI
-- ---------- -------------------- -------
1 a 语文 80
2 a 数学 70
3 b 语文 40
4 b 数学 100
5 c 语文 90
6 c 数学 92
那末我要求显示的结果是:
NAME YUWEN SHUXUE
---------- ---------------------- ----------------------
a 80 &n
相关文档:
Checking kernel parameters
Checking for semmsl=250; found semmsl=250. Passed
Checking for semmns=32000; found semmns=32000. Passed
Checking for semopm=100; found semopm=32. Failed <<<<
Checking for semmni=128; found semmni=128.&nb ......
(1)登陆到mysql
C:\Documents and Settings\Administrator>mysql -h localhost -u root -p
Enter password: *****
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 69
Server version: 5.0.51a-community-nt MySQL Community Edition (GPL)
Type 'help;' or '\h' fo ......
很不幸,建立的表被某人误删了,,,
还好可以通过这样恢复。
select * from user_recyclebin where original_name like 'FINANCE_%' order by droptime desc;
FLASHBACK TABLE FINANCE_CASE_FEE_ITEM TO BEFORE DROP
即所有drop的表都在 user_recyclebin 这个oracle回收站里面的,再通过flashback命 ......
Oracle 中的树查询和 connect by
使用 connect by 和 start with 来建立类似于树的报表并不难,只要遵循以下基本原则即可:
使用 connect by 时各子句的顺序应为:
select
from
where
start with
connect by
order by
prior 使报表的顺序为从根到叶(如果 prior 列是父辈)或从叶到根(如果 prior 列是后代)。
......
ADDM (Automatic Database Diagnostic Monitor) implements the Oracle performance method and analyzes statistics to provide automatic diagnosis of major performance problems. Because ADDM can significantly shorten the time required to improve the performance of a system, it is one of the most used perf ......