- 浏览: 264162 次
- 性别:
- 来自: 长沙
文章分类
最新评论
-
ae6623:
楼主,没必要用json2.js,jquery自己就可以去解析j ...
JQuery、JSON、Ajax在Servlet中的应用 -
hw1287789687:
http://ljhzzyx.blog.163.com/blo ...
MyEclipse中如何去掉JS/JSP 语法错误提示 -
xiaokang1582830:
不知所云...
处理 Struts2 框架上传的文件 -
halfwaters:
使用vs2010,加上扩展管理器安装的js插件
MyEclipse中如何去掉JS/JSP 语法错误提示 -
ayumi11111:
附件呢 我····
jQuery+Ajax+Struts2. js javascript
/* Formatted on 2011/04/19 20:40 (Formatter Plus v4.8.6) */
SELECT bill_type billtype, query_type querytype,
materiel_type_id materieltypeid, z0000 z0000, z0731 z0731,
z0733 z0733, z0732 z0732, z0734 z0734, z0737 z0737, z0730 z0730,
z0736 z0736, z0744 z0744, z0746 z0746, z0745 z0745, z0738 z0738,
z0739 z0739, z0735 z0735, z0743 z0743
FROM (SELECT '0' query_type, v.bill_type, v.materiel_type_id,
SUM (DECODE (DECODE (v.area_id, '0000', v.materiel_num),
'', 0,
v.materiel_num
)
) z0000,
SUM (DECODE (DECODE (v.area_id, '0731', v.materiel_num),
'', 0,
v.materiel_num
)
) z0731,
SUM (DECODE (DECODE (v.area_id, '0733', v.materiel_num),
'', 0,
v.materiel_num
)
) z0733,
SUM (DECODE (DECODE (v.area_id, '0732', v.materiel_num),
'', 0,
v.materiel_num
)
) z0732,
SUM (DECODE (DECODE (v.area_id, '0734', v.materiel_num),
'', 0,
v.materiel_num
)
) z0734,
SUM (DECODE (DECODE (v.area_id, '0737', v.materiel_num),
'', 0,
v.materiel_num
)
) z0737,
SUM (DECODE (DECODE (v.area_id, '0730', v.materiel_num),
'', 0,
v.materiel_num
)
) z0730,
SUM (DECODE (DECODE (v.area_id, '0736', v.materiel_num),
'', 0,
v.materiel_num
)
) z0736,
SUM (DECODE (DECODE (v.area_id, '0744', v.materiel_num),
'', 0,
v.materiel_num
)
) z0744,
SUM (DECODE (DECODE (v.area_id, '0746', v.materiel_num),
'', 0,
v.materiel_num
)
) z0746,
SUM (DECODE (DECODE (v.area_id, '0745', v.materiel_num),
'', 0,
v.materiel_num
)
) z0745,
SUM (DECODE (DECODE (v.area_id, '0738', v.materiel_num),
'', 0,
v.materiel_num
)
) z0738,
SUM (DECODE (DECODE (v.area_id, '0739', v.materiel_num),
'', 0,
v.materiel_num
)
) z0739,
SUM (DECODE (DECODE (v.area_id, '0735', v.materiel_num),
'', 0,
v.materiel_num
)
) z0735,
SUM (DECODE (DECODE (v.area_id, '0743', v.materiel_num),
'', 0,
v.materiel_num
)
) z0743
FROM v_inout_month_report v
WHERE 1 = 1
AND ( v.districtid IN (
SELECT man_obj_id
FROM td_sge_keeping_ref
WHERE keeping_id = 'csck1'
AND manager_level = 1)
OR v.storehouse_id IN (
SELECT man_obj_id
FROM td_sge_keeping_ref
WHERE keeping_id = 'csck1'
AND manager_level = 0)
)
GROUP BY v.materiel_type_id, v.bill_type
UNION
SELECT '1' query_type, bill_type, materiel_type_id,
SUM (DECODE (a.area_id, '0000', 1, 0)) z0000,
SUM (DECODE (a.area_id, '0731', 1, 0)) z0731,
SUM (DECODE (a.area_id, '0733', 1, 0)) z0733,
SUM (DECODE (a.area_id, '0732', 1, 0)) z0732,
SUM (DECODE (a.area_id, '0734', 1, 0)) z0734,
SUM (DECODE (a.area_id, '0737', 1, 0)) z0737,
SUM (DECODE (a.area_id, '0730', 1, 0)) z0730,
SUM (DECODE (a.area_id, '0736', 1, 0)) z0736,
SUM (DECODE (a.area_id, '0744', 1, 0)) z0744,
SUM (DECODE (a.area_id, '0746', 1, 0)) z0746,
SUM (DECODE (a.area_id, '0745', 1, 0)) z0745,
SUM (DECODE (a.area_id, '0738', 1, 0)) z0738,
SUM (DECODE (a.area_id, '0739', 1, 0)) z0739,
SUM (DECODE (a.area_id, '0735', 1, 0)) z0735,
SUM (DECODE (a.area_id, '0743', 1, 0)) z0743
FROM (SELECT DISTINCT v.area_id, v.bill_type, v.bill_id,
v.materiel_type_id
FROM v_inout_month_report v
WHERE 1 = 1
AND ( v.districtid IN (
SELECT man_obj_id
FROM td_sge_keeping_ref
WHERE keeping_id = 'csck1'
AND manager_level = 1)
OR v.storehouse_id IN (
SELECT man_obj_id
FROM td_sge_keeping_ref
WHERE keeping_id = 'csck1'
AND manager_level = 0)
)) a
GROUP BY a.bill_type, materiel_type_id
UNION
SELECT '2' query_type, bill_type, materiel_type_id,
SUM (DECODE (a.area_id, '0000', 1, 0)) z0000,
SUM (DECODE (a.area_id, '0731', 1, 0)) z0731,
SUM (DECODE (a.area_id, '0733', 1, 0)) z0733,
SUM (DECODE (a.area_id, '0732', 1, 0)) z0732,
SUM (DECODE (a.area_id, '0734', 1, 0)) z0734,
SUM (DECODE (a.area_id, '0737', 1, 0)) z0737,
SUM (DECODE (a.area_id, '0730', 1, 0)) z0730,
SUM (DECODE (a.area_id, '0736', 1, 0)) z0736,
SUM (DECODE (a.area_id, '0744', 1, 0)) z0744,
SUM (DECODE (a.area_id, '0746', 1, 0)) z0746,
SUM (DECODE (a.area_id, '0745', 1, 0)) z0745,
SUM (DECODE (a.area_id, '0738', 1, 0)) z0738,
SUM (DECODE (a.area_id, '0739', 1, 0)) z0739,
SUM (DECODE (a.area_id, '0735', 1, 0)) z0735,
SUM (DECODE (a.area_id, '0743', 1, 0)) z0743
FROM (SELECT DISTINCT v.materiel_id, v.materiel_type_id,
v.area_id, v.bill_type
FROM v_inout_month_report v
WHERE 1 = 1
AND ( v.districtid IN (
SELECT man_obj_id
FROM td_sge_keeping_ref
WHERE keeping_id = 'csck1'
AND manager_level = 1)
OR v.storehouse_id IN (
SELECT man_obj_id
FROM td_sge_keeping_ref
WHERE keeping_id = 'csck1'
AND manager_level = 0)
)) a
GROUP BY materiel_type_id, bill_type)
ORDER BY bill_type, query_type, materiel_type_id
SELECT bill_type billtype, query_type querytype,
materiel_type_id materieltypeid, z0000 z0000, z0731 z0731,
z0733 z0733, z0732 z0732, z0734 z0734, z0737 z0737, z0730 z0730,
z0736 z0736, z0744 z0744, z0746 z0746, z0745 z0745, z0738 z0738,
z0739 z0739, z0735 z0735, z0743 z0743
FROM (SELECT '0' query_type, v.bill_type, v.materiel_type_id,
SUM (DECODE (DECODE (v.area_id, '0000', v.materiel_num),
'', 0,
v.materiel_num
)
) z0000,
SUM (DECODE (DECODE (v.area_id, '0731', v.materiel_num),
'', 0,
v.materiel_num
)
) z0731,
SUM (DECODE (DECODE (v.area_id, '0733', v.materiel_num),
'', 0,
v.materiel_num
)
) z0733,
SUM (DECODE (DECODE (v.area_id, '0732', v.materiel_num),
'', 0,
v.materiel_num
)
) z0732,
SUM (DECODE (DECODE (v.area_id, '0734', v.materiel_num),
'', 0,
v.materiel_num
)
) z0734,
SUM (DECODE (DECODE (v.area_id, '0737', v.materiel_num),
'', 0,
v.materiel_num
)
) z0737,
SUM (DECODE (DECODE (v.area_id, '0730', v.materiel_num),
'', 0,
v.materiel_num
)
) z0730,
SUM (DECODE (DECODE (v.area_id, '0736', v.materiel_num),
'', 0,
v.materiel_num
)
) z0736,
SUM (DECODE (DECODE (v.area_id, '0744', v.materiel_num),
'', 0,
v.materiel_num
)
) z0744,
SUM (DECODE (DECODE (v.area_id, '0746', v.materiel_num),
'', 0,
v.materiel_num
)
) z0746,
SUM (DECODE (DECODE (v.area_id, '0745', v.materiel_num),
'', 0,
v.materiel_num
)
) z0745,
SUM (DECODE (DECODE (v.area_id, '0738', v.materiel_num),
'', 0,
v.materiel_num
)
) z0738,
SUM (DECODE (DECODE (v.area_id, '0739', v.materiel_num),
'', 0,
v.materiel_num
)
) z0739,
SUM (DECODE (DECODE (v.area_id, '0735', v.materiel_num),
'', 0,
v.materiel_num
)
) z0735,
SUM (DECODE (DECODE (v.area_id, '0743', v.materiel_num),
'', 0,
v.materiel_num
)
) z0743
FROM v_inout_month_report v
WHERE 1 = 1
AND ( v.districtid IN (
SELECT man_obj_id
FROM td_sge_keeping_ref
WHERE keeping_id = 'csck1'
AND manager_level = 1)
OR v.storehouse_id IN (
SELECT man_obj_id
FROM td_sge_keeping_ref
WHERE keeping_id = 'csck1'
AND manager_level = 0)
)
GROUP BY v.materiel_type_id, v.bill_type
UNION
SELECT '1' query_type, bill_type, materiel_type_id,
SUM (DECODE (a.area_id, '0000', 1, 0)) z0000,
SUM (DECODE (a.area_id, '0731', 1, 0)) z0731,
SUM (DECODE (a.area_id, '0733', 1, 0)) z0733,
SUM (DECODE (a.area_id, '0732', 1, 0)) z0732,
SUM (DECODE (a.area_id, '0734', 1, 0)) z0734,
SUM (DECODE (a.area_id, '0737', 1, 0)) z0737,
SUM (DECODE (a.area_id, '0730', 1, 0)) z0730,
SUM (DECODE (a.area_id, '0736', 1, 0)) z0736,
SUM (DECODE (a.area_id, '0744', 1, 0)) z0744,
SUM (DECODE (a.area_id, '0746', 1, 0)) z0746,
SUM (DECODE (a.area_id, '0745', 1, 0)) z0745,
SUM (DECODE (a.area_id, '0738', 1, 0)) z0738,
SUM (DECODE (a.area_id, '0739', 1, 0)) z0739,
SUM (DECODE (a.area_id, '0735', 1, 0)) z0735,
SUM (DECODE (a.area_id, '0743', 1, 0)) z0743
FROM (SELECT DISTINCT v.area_id, v.bill_type, v.bill_id,
v.materiel_type_id
FROM v_inout_month_report v
WHERE 1 = 1
AND ( v.districtid IN (
SELECT man_obj_id
FROM td_sge_keeping_ref
WHERE keeping_id = 'csck1'
AND manager_level = 1)
OR v.storehouse_id IN (
SELECT man_obj_id
FROM td_sge_keeping_ref
WHERE keeping_id = 'csck1'
AND manager_level = 0)
)) a
GROUP BY a.bill_type, materiel_type_id
UNION
SELECT '2' query_type, bill_type, materiel_type_id,
SUM (DECODE (a.area_id, '0000', 1, 0)) z0000,
SUM (DECODE (a.area_id, '0731', 1, 0)) z0731,
SUM (DECODE (a.area_id, '0733', 1, 0)) z0733,
SUM (DECODE (a.area_id, '0732', 1, 0)) z0732,
SUM (DECODE (a.area_id, '0734', 1, 0)) z0734,
SUM (DECODE (a.area_id, '0737', 1, 0)) z0737,
SUM (DECODE (a.area_id, '0730', 1, 0)) z0730,
SUM (DECODE (a.area_id, '0736', 1, 0)) z0736,
SUM (DECODE (a.area_id, '0744', 1, 0)) z0744,
SUM (DECODE (a.area_id, '0746', 1, 0)) z0746,
SUM (DECODE (a.area_id, '0745', 1, 0)) z0745,
SUM (DECODE (a.area_id, '0738', 1, 0)) z0738,
SUM (DECODE (a.area_id, '0739', 1, 0)) z0739,
SUM (DECODE (a.area_id, '0735', 1, 0)) z0735,
SUM (DECODE (a.area_id, '0743', 1, 0)) z0743
FROM (SELECT DISTINCT v.materiel_id, v.materiel_type_id,
v.area_id, v.bill_type
FROM v_inout_month_report v
WHERE 1 = 1
AND ( v.districtid IN (
SELECT man_obj_id
FROM td_sge_keeping_ref
WHERE keeping_id = 'csck1'
AND manager_level = 1)
OR v.storehouse_id IN (
SELECT man_obj_id
FROM td_sge_keeping_ref
WHERE keeping_id = 'csck1'
AND manager_level = 0)
)) a
GROUP BY materiel_type_id, bill_type)
ORDER BY bill_type, query_type, materiel_type_id
发表评论
-
转载]linux下启动oracle
2012-03-06 14:56 1123启动数据库实例,分为两步:第一步,启动监听;第二步,启动数据库 ... -
sql中时间相减(case when then的用法)
2011-04-19 20:24 3506select f.FILE_ID,f.FILE_NAME,f. ... -
Oracle的取整和四舍五入函数 时间相减
2011-03-24 18:50 4612注:以下内容转载自http://hi.baidu.com/de ... -
【转】oracle中导入导出dmp数据库文件语句使用
2010-12-18 11:30 6706Oracle数据导入导出imp/exp ... -
oracle表中怎么建序列
2010-11-30 19:13 1259在oracle中sequence就是所 ... -
oracle伪列 分页
2010-11-27 17:52 1260/* Formatted on 2010/11/26 09:0 ... -
oracle中截取字符串的方法
2010-09-06 20:52 6419oracle 中截取字符串的情况如下: (1) 可以截取某 ... -
sql语句做数据初始化(科创)
2010-09-04 17:09 1424delete from td_project_integral ... -
Oracle通过job定时创建表-入门基础
2010-08-31 15:14 1709在项目中,经常会遇到需要定时完成的任务,比如定时更新数据, ... -
数据库应用开发工具Toad使用笔记
2010-08-07 16:45 1417TOAD使用笔记 1、把 ... -
Oracle 创建删除用户、角色、表空间、导入导出、备份 命令总结
2010-05-20 17:30 2955导入导出实用程序用于实施数据库的逻辑备份和恢复 导出实用将数据 ... -
oracle 的 Sql操作流程
2010-05-20 17:30 1128没有给你用户和密码的时候: 1、创建用户: 打开 ... -
oracle pl/sql语句大全
2010-05-20 15:16 2083例 select ename,sal,next_day(s ...
相关推荐
在 SQL 语句中,DECODE 和 NVL 函数是两个非常重要和常用的函数,它们可以帮助我们实现复杂的逻辑判断和数据处理。本文将详细介绍 DECODE 和 NVL 函数的使用方法和实践应用。 一、DECODE 函数 DECODE 函数是 ...
在SQL中,可以使用WHERE子句过滤数据,并使用ORDER BY子句对结果集进行排序。 **示例代码:** ```sql SELECT * FROM student_info WHERE NOT EXISTS ( SELECT * FROM student WHERE student_info.id = student.id ...
### SQL语句介绍及使用方法 #### 知识点一:查询指定时间前的数据 在数据库管理过程中,经常需要查询某一特定时间之前的数据。例如,要查询一小时前的数据,可以使用如下的SQL语句: ```sql SELECT * FROM asoft ...
### ASP中的精妙SQL语句...以上就是从给定的文件标题、描述、标签及部分内容中提炼出来的精妙SQL语句实例及其详细解析。这些SQL语句涵盖了从简单的数据更新到复杂的数据处理等多个方面,希望对学习和实际应用有所帮助。
以下是对给定文件中SQL语句的详细讲解和实例分析: 1. **复制表结构:** ```sql SELECT * INTO b FROM a WHERE 1<>1 ``` 这个命令会创建一个新的表`b`,并从表`a`中复制所有的列定义,但不复制任何数据。`WHERE...
### SQL语句执行顺序说明 #### 一、SQL语句准备执行阶段 当SQL语句进入Oracle的库缓存后,为了确保其...通过遵循上述步骤和技巧,可以有效地提高SQL语句在Oracle数据库中的执行效率,从而提升应用程序的整体性能。
在SQL的世界里,掌握一些精妙的SQL语句可以极大地提升你的工作效率,使你在处理数据库时游刃有余。以下是一些高级SQL技巧的详细解释: 1. **复制表结构而不复制数据** 使用`SELECT * INTO 新表名 FROM 原表名 ...
在SQL(Structured Query Language)中,我们经常使用各种语句来操作数据库,包括查询、插入、更新、删除等。以下是一些常见的SQL语句及其详细解释: 1. **复制表结构**: ```sql SELECT * INTO b FROM a WHERE 1...
此SQL语句用于获取当前用户在SQL*PLUS中的会话标识符和序列号。 **SQL语句**: ```sql SQL>select sid, serial#, status from v$session where audsid = userenv('sessionid'); ``` **解释**: - `v$session`: 包含...
上述SQL查询语句仅为一种基础方法,实际工作中还需要结合具体的业务场景和技术需求来进行综合分析与优化。此外,Oracle提供了多种高级工具和特性来支持性能监控与优化,建议根据实际情况灵活运用。
- **标题中的“精妙的SQL语句”** 暗示了这些SQL语句不仅实用,而且在某些方面有着巧妙的设计。 - **描述中的“对学习SQL有很大帮助”** 表明这些SQL语句对于学习者来说是非常有价值的。 **详细知识点说明:** 1. ...
在Web开发中,SQL(Structured Query Language)是用于管理和处理关系型数据库的重要工具。以下是一些常见的SQL语句及其用途: 1. **复制表结构**: ```sql SELECT * INTO b FROM a WHERE 1<>1 ``` 这条语句...
- **使用V$SQLAREA视图**:通过查看V$SQLAREA视图中的统计信息(如EXECUTIONS、DISK_READS、BUFFER_GETS等),可以了解SQL语句的执行效率,进而找出性能瓶颈所在。 #### 11. 优化索引使用 - **合理设计索引**:对于...
### Oracle常用性能监控SQL语句知识点详解 #### 1. 监控高磁盘读取的SQL区域 **SQL语句:** ```sql select * from sys.v_$sqlarea where disk_reads > 100; ``` - **知识点解读:** - `sys.v_$sqlarea` 视图提供了...
数据库性能监控SQL帮助语句 数据库性能监控是数据库管理员的重要任务之一。通过监控数据库的性能,可以快速发现问题,提高数据库的运行效率和稳定性。本文将为您提供九个实用的SQL帮助语句,帮助您监控数据库的性能...
这条SQL语句用于删除表`info`中那些其`infid`在副表`info_bz`中不存在的记录。这里使用了`NOT EXISTS`子句来判断是否在副表中存在对应的记录,从而决定是否进行删除操作。 ### 7. 复杂的联表查询 **SQL语句示例**...
DECODE函数可以避免重复扫描相同记录或连接相同表,特别是在复杂的条件判断场景中,使用DECODE可以显著减少处理时间,提高查询性能。 #### 用WHERE子句替换HAVING子句 **方法十:优化HAVING使用** HAVING子句在...
在本文中,我们将快速入门SQL语句的编写与应用,同时简单回顾SQL的发展历程及其前景。 1. SQL语言基础 SQL包含多种语句,用于执行数据库的各种操作。常见的SQL语句包括: - SELECT:用于查询表中的数据。 - INSERT...
### ORACLE DECODE函数在中国式报表统计查询中的组合条件实现 #### 一、引言 在Oracle数据库中,`DECODE`函数是一种非常实用的功能,主要用于条件判断并返回不同的值。它经常被用来进行简单的条件分支处理,尤其...