- 浏览: 274417 次
文章分类
最新评论
-
yonghuuser:
< namespace > http://www. ...
使用 xfire 开发 web service 应用 -
悬空90:
牛人 呵呵
JCS 资料 -
悬空90:
谢谢分享 呵呵
JCS 应用 -
kuiye:
用于在客户端页面调用.
DWR util.js 整理(DWR 处理各种form表单Select/option,table等,List,Bean -
bo_hai:
好像不是原创呢!
抽象类与接口的区别
sql 代码
- select * from ( select * from(
- select sum(isnull(aa,0)) as a,sum(bb)as b,sum(cc)as c,sum(dd)as d,sum(ee)as e
- from ( select
- case c1.store_type when 1 then a1StoreCount else 0 end as aa,
- case c1.store_type when 2 then a1StoreCount else 0 end as bb,
- case c1.store_type when 3 then a1StoreCount else 0 end as cc,
- case c1.store_type when 4 then a1StoreCount else 0 end as dd,
- case c1.store_type when 5 then a1StoreCount else 0 end as ee
- from ( SELECT a1.store_type,a1.item_name, count(a1.store_id) as a1StoreCount
- FROM BIZ_PROD_PRICE p inner join
- (SELECT s.store_type,p.id,p.store_id,i.id as iid,i.item_name, pd.prod_name, pi.prod_price
- FROM BIZ_PROD_PRICE p INNER JOIN
- BIZ_PROD_PRICE_ITEM pi ON p.id = pi.main_id INNER JOIN
- dim_store s on s.id=p.store_id inner join
- dim_dict_item i on i.id=s.store_type inner join
- dim_product pd ON pd.id = pi.prod_id
- inner join dim_geography g ON s.geo_id = g.id
- inner join dim_geography g1 ON g.parent_geography_id = g1.id
- WHERE pd.id = 284 and $P!{queryString}) a1 on p.id=a1.id INNER JOIN
- (SELECT p.id,p.store_id,i.id as iid,i.item_name, pd.prod_name, pi.prod_price
- FROM BIZ_PROD_PRICE p INNER JOIN
- BIZ_PROD_PRICE_ITEM pi ON p.id = pi.main_id INNER JOIN
- dim_store s on s.id=p.store_id inner join
- dim_dict_item i on i.id=s.store_type inner join
- dim_compt_prod pd ON pd.id = pi.prod_id
- inner join dim_geography g ON s.geo_id = g.id
- inner join dim_geography g1 ON g.parent_geography_id = g1.id
- WHERE pd.id = 17 and $P!{queryString}) a2 ON a1.store_id = a2.store_id AND
- a1.prod_price > a2.prod_price and a1.iid=a2.iid
- group by a1.item_name,a1.store_type
- )c1
- )e1)d,
- (select sum(aa) as a1,sum(bb)as b1,sum(cc)as c1,sum(dd)as d1,sum(ee)as e1
- from ( select
- case c1.store_type when 1 then a1StoreCount else 0 end as aa,
- case c1.store_type when 2 then a1StoreCount else 0 end as bb,
- case c1.store_type when 3 then a1StoreCount else 0 end as cc,
- case c1.store_type when 4 then a1StoreCount else 0 end as dd,
- case c1.store_type when 5 then a1StoreCount else 0 end as ee
- from (SELECT a1.store_type,a1.item_name, count(a1.store_id) as a1StoreCount FROM
- BIZ_PROD_PRICE p inner join
- (SELECT s.store_type,p.id,p.store_id,i.id as iid,i.item_name, pd.prod_name, pi.prod_price
- FROM BIZ_PROD_PRICE p INNER JOIN
- BIZ_PROD_PRICE_ITEM pi ON p.id = pi.main_id INNER JOIN
- dim_store s on s.id=p.store_id inner join
- dim_dict_item i on i.id=s.store_type inner join
- dim_product pd ON pd.id = pi.prod_id
- inner join dim_geography g ON s.geo_id = g.id
- inner join dim_geography g1 ON g.parent_geography_id = g1.id
- WHERE pd.id = 284 and $P!{queryString}) a1 on p.id=a1.id INNER JOIN
- (SELECT p.id,p.store_id,i.id as iid,i.item_name, pd.prod_name, pi.prod_price
- FROM BIZ_PROD_PRICE p INNER JOIN
- BIZ_PROD_PRICE_ITEM pi ON p.id = pi.main_id INNER JOIN
- dim_store s on s.id=p.store_id inner join
- dim_dict_item i on i.id=s.store_type inner join
- dim_compt_prod pd ON pd.id = pi.prod_id
- inner join dim_geography g ON s.geo_id = g.id
- inner join dim_geography g1 ON g.parent_geography_id = g1.id
- WHERE pd.id = 50 and $P!{queryString}) a2 ON a1.store_id = a2.store_id AND
- a1.prod_price > a2.prod_price and a1.iid=a2.iid and p.id=a2.id
- group by a1.item_name,a1.store_type
- )c1
- )e2)d1,
- (
- select sum(aa) as a2,sum(bb)as b2,sum(cc)as c2,sum(dd)as d2,sum(ee)as e2
- from ( select
- case c1.store_type when 1 then a1StoreCount else 0 end as aa,
- case c1.store_type when 2 then a1StoreCount else 0 end as bb,
- case c1.store_type when 3 then a1StoreCount else 0 end as cc,
- case c1.store_type when 4 then a1StoreCount else 0 end as dd,
- case c1.store_type when 5 then a1StoreCount else 0 end as ee
- from (SELECT a1.store_type,a1.item_name,count(a1.store_id) as a1StoreCount FROM
- BIZ_PROD_PRICE p inner join
- (SELECT s.store_type,p.id,p.store_id,i.id as iid,i.item_name, pd.prod_name, pi.prod_price
- FROM BIZ_PROD_PRICE p INNER JOIN
- BIZ_PROD_PRICE_ITEM pi ON p.id = pi.main_id INNER JOIN
- dim_store s on s.id=p.store_id inner join
- dim_dict_item i on i.id=s.store_type inner join
- dim_product pd ON pd.id = pi.prod_id
- inner join dim_geography g ON s.geo_id = g.id
- inner join dim_geography g1 ON g.parent_geography_id = g1.id
- WHERE pd.id = 343 and $P!{queryString}) a1 on p.id=a1.id INNER JOIN
- (SELECT p.id,p.store_id,i.id as iid,i.item_name, pd.prod_name, pi.prod_price
- FROM BIZ_PROD_PRICE p INNER JOIN
- BIZ_PROD_PRICE_ITEM pi ON p.id = pi.main_id INNER JOIN
- dim_store s on s.id=p.store_id inner join
- dim_dict_item i on i.id=s.store_type inner join
- dim_compt_prod pd ON pd.id = pi.prod_id
- inner join dim_geography g ON s.geo_id = g.id
- inner join dim_geography g1 ON g.parent_geography_id = g1.id
- WHERE pd.id = 22 and $P!{queryString}) a2 ON a1.store_id = a2.store_id AND
- a1.prod_price > a2.prod_price and a1.iid=a2.iid
- group by a1.item_name,a1.store_type
- )c1
- )e3)d2,
- (
- select sum(aa) as a3,sum(bb)as b3,sum(cc)as c3,sum(dd)as d3,sum(ee)as e3
- from ( select
- case c1.store_type when 1 then a1StoreCount else 0 end as aa,
- case c1.store_type when 2 then a1StoreCount else 0 end as bb,
- case c1.store_type when 3 then a1StoreCount else 0 end as cc,
- case c1.store_type when 4 then a1StoreCount else 0 end as dd,
- case c1.store_type when 5 then a1StoreCount else 0 end as ee
- from (SELECT a1.store_type,a1.item_name,count(a1.store_id) as a1StoreCount FROM
- BIZ_PROD_PRICE p inner join
- (SELECT s.store_type,p.id,p.store_id,i.id as iid,i.item_name, pd.prod_name, pi.prod_price
- FROM BIZ_PROD_PRICE p INNER JOIN
- BIZ_PROD_PRICE_ITEM pi ON p.id = pi.main_id INNER JOIN
- dim_store s on s.id=p.store_id inner join
- dim_dict_item i on i.id=s.store_type inner join
- dim_product pd ON pd.id = pi.prod_id
- inner join dim_geography g ON s.geo_id = g.id
- inner join dim_geography g1 ON g.parent_geography_id = g1.id
- WHERE pd.id = 341 and $P!{queryString}) a1 on p.id=a1.id INNER JOIN
- (SELECT p.id,p.store_id,i.id as iid,i.item_name, pd.prod_name, pi.prod_price
- FROM BIZ_PROD_PRICE p INNER JOIN
- BIZ_PROD_PRICE_ITEM pi ON p.id = pi.main_id INNER JOIN
- dim_store s on s.id=p.store_id inner join
- dim_dict_item i on i.id=s.store_type inner join
- dim_compt_prod pd ON pd.id = pi.prod_id
- inner join dim_geography g ON s.geo_id = g.id
- inner join dim_geography g1 ON g.parent_geography_id = g1.id
- WHERE pd.id = 22 and $P!{queryString}) a2 ON a1.store_id = a2.store_id AND
- a1.prod_price > a2.prod_price and a1.iid=a2.iid
- group by a1.item_name,a1.store_type
- )c1
- )e4)d3,
- (
- select sum(aa) as a4,sum(bb)as b4,sum(cc)as c4,sum(dd)as d4,sum(ee)as e4
- from (
- select
- case c1.store_type when 1 then a1StoreCount else 0 end as aa,
- case c1.store_type when 2 then a1StoreCount else 0 end as bb,
- case c1.store_type when 3 then a1StoreCount else 0 end as cc,
- case c1.store_type when 4 then a1StoreCount else 0 end as dd,
- case c1.store_type when 5 then a1StoreCount else 0 end as ee
- from
- (SELECT a1.store_type,a1.item_name,count(a1.store_id) as a1StoreCount
- FROM
- BIZ_PROD_PRICE p inner join
- (SELECT s.store_type,p.id,p.store_id,i.id as iid,i.item_name, pd.prod_name, pi.prod_price
- FROM BIZ_PROD_PRICE p INNER JOIN
- BIZ_PROD_PRICE_ITEM pi ON p.id = pi.main_id INNER JOIN
- dim_store s on s.id=p.store_id inner join
- dim_dict_item i on i.id=s.store_type inner join
- dim_product pd ON pd.id = pi.prod_id
- inner join dim_geography g ON s.geo_id = g.id
- inner join dim_geography g1 ON g.parent_geography_id = g1.id
- WHERE pd.id = 345 and $P!{queryString}) a1 on p.id=a1.id INNER JOIN
- (SELECT p.id,p.store_id,i.id as iid,i.item_name, pd.prod_name, pi.prod_price
- FROM BIZ_PROD_PRICE p INNER JOIN
- BIZ_PROD_PRICE_ITEM pi ON p.id = pi.main_id INNER JOIN
- dim_store s on s.id=p.store_id inner join
- dim_dict_item i on i.id=s.store_type inner join
- dim_compt_prod pd ON pd.id = pi.prod_id
- inner join dim_geography g ON s.geo_id = g.id
- inner join dim_geography g1 ON g.parent_geography_id = g1.id
- WHERE pd.id = 22 and $P!{queryString}) a2 ON a1.store_id = a2.store_id AND
- a1.prod_price > a2.prod_price and a1.iid=a2.iid
- group by a1.item_name,a1.store_type
- )c1
- )e5)d4
- )w1,
- ---lower-----------------------------------------------------------------
- ( select * from(
- select sum(isnull(aa,0)) as sa,sum(bb)as sb,sum(cc)as sc,sum(dd)as sd,sum(ee)as se from (
- select
- case c1.store_type when 1 then a1StoreCount else 0 end as aa,
- case c1.store_type when 2 then a1StoreCount else 0 end as bb,
- case c1.store_type when 3 then a1StoreCount else 0 end as cc,
- case c1.store_type when 4 then a1StoreCount else 0 end as dd,
- case c1.store_type when 5 then a1StoreCount else 0 end as ee
- from ( SELECT a1.store_type,a1.item_name, count(a1.store_id) as a1StoreCount FROM
- BIZ_PROD_PRICE p inner join
- (SELECT s.store_type,p.id,p.store_id,i.id as iid,i.item_name, pd.prod_name, pi.prod_price
- FROM BIZ_PROD_PRICE p INNER JOIN
- BIZ_PROD_PRICE_ITEM pi ON p.id = pi.main_id INNER JOIN
- dim_store s on s.id=p.store_id inner join
- dim_dict_item i on i.id=s.store_type inner join
- dim_product pd ON pd.id = pi.prod_id
- inner join dim_geography g ON s.geo_id = g.id
- inner join dim_geography g1 ON g.parent_geography_id = g1.id
- WHERE pd.id = 284 and $P!{queryString}) a1 on p.id=a1.id INNER JOIN
- (SELECT p.id,p.store_id,i.id as iid,i.item_name, pd.prod_name, pi.prod_price
- FROM BIZ_PROD_PRICE p INNER JOIN
- BIZ_PROD_PRICE_ITEM pi ON p.id = pi.main_id INNER JOIN
- dim_store s on s.id=p.store_id inner join
- dim_dict_item i on i.id=s.store_type inner join
- dim_compt_prod pd ON pd.id = pi.prod_id
- inner join dim_geography g ON s.geo_id = g.id
- inner join dim_geography g1 ON g.parent_geography_id = g1.id
- WHERE pd.id = 17 and $P!{queryString}) a2 ON a1.store_id = a2.store_id AND
- a1.prod_price <= a2.prod_price and a1.iid=a2.iid
- group by a1.item_name,a1.store_type
- )c1 )e1)d,
- (select sum(aa) as sa1,sum(bb)as sb1,sum(cc)as sc1,sum(dd)as sd1,sum(ee)as se1
- from ( select
- case c1.store_type when 1 then a1StoreCount else 0 end as aa,
- case c1.store_type when 2 then a1StoreCount else 0 end as bb,
- case c1.store_type when 3 then a1StoreCount else 0 end as cc,
- case c1.store_type when 4 then a1StoreCount else 0 end as dd,
- case c1.store_type when 5 then a1StoreCount else 0 end as ee
- from
- (SELECT a1.store_type,a1.item_name, count(a1.store_id) as a1StoreCount
- FROM
- BIZ_PROD_PRICE p inner join
- (SELECT s.store_type,p.id,p.store_id,i.id as iid,i.item_name, pd.prod_name, pi.prod_price
- FROM BIZ_PROD_PRICE p INNER JOIN
- BIZ_PROD_PRICE_ITEM pi ON p.id = pi.main_id INNER JOIN
- dim_store s on s.id=p.store_id inner join
- dim_dict_item i on i.id=s.store_type inner join
- dim_product pd ON pd.id = pi.prod_id
- inner join dim_geography g ON s.geo_id = g.id
- inner join dim_geography g1 ON g.parent_geography_id = g1.id
- WHERE pd.id = 284 and $P!{queryString}) a1 on p.id=a1.id INNER JOIN
- (SELECT p.id,p.store_id,i.id as iid,i.item_name, pd.prod_name, pi.prod_price
- FROM BIZ_PROD_PRICE p INNER JOIN
- BIZ_PROD_PRICE_ITEM pi ON p.id = pi.main_id INNER JOIN
- dim_store s on s.id=p.store_id inner join
- dim_dict_item i on i.id=s.store_type inner join
- dim_compt_prod pd ON pd.id = pi.prod_id
- inner join dim_geography g ON s.geo_id = g.id
- inner join dim_geography g1 ON g.parent_geography_id = g1.id
- WHERE pd.id = 50 and $P!{queryString}) a2 ON a1.store_id = a2.store_id AND
- a1.prod_price <= a2.prod_price and a1.iid=a2.iid and p.id=a2.id
- group by a1.item
发表评论
-
数据库设计3NF
2007-08-12 17:47 2799数据库的设计范式是数据库设计所需要满足的规范,满足这些规范的数 ... -
jdbc事务处理
2007-08-08 23:44 12081在JDBC的数据库操作中,一项事务是由一条或是多条表达式所组成 ... -
SQL SERVER 数据库无法连接
2007-07-07 19:53 2750本来运行一切正常的程序,换了一台服务器,一连报错: 2 ... -
SQL Server安装:以前的某个程序安装已在安装计算机上创建挂起的文件操作
2007-07-06 14:20 1845打开注册表编辑器,在HKEY_LOCAL_MACHINE\SY ... -
sql 整理(二)
2007-06-05 11:10 1392sql 代码 1、********************** ... -
sql 整理(一)
2007-06-05 10:59 11351、***************************** ...
相关推荐
标题中的“sql语句整理工具”指的是用于优化和格式化SQL查询语句的软件或应用程序。这类工具的主要目的是帮助数据库管理员和开发人员更好地管理和理解复杂的SQL代码,使其更规范、可读性更强,从而提高工作效率。 ...
SQL语句格式整理器是一款非常实用的工具,它专门针对SQL查询语句的排版混乱问题,通过自动化处理,帮助用户快速将杂乱无章的SQL代码转化为整洁、易读的格式。这样的工具在数据库管理和开发过程中尤为重要,因为它...
SQL跟踪后,用该工具能够快速整理出整洁的SQL,减少人工的复制、帖贴
sqllice是一款专为解决SQL代码格式混乱问题而设计的工具,它能够帮助开发人员快速、高效地整理SQL脚本,使其更符合编程规范,提高代码可读性和团队协作效率。无论你是使用Java、Python、C#还是其他语言进行开发,...
本文将基于"oracle常用sql整理"的主题,深入探讨Oracle SQL的一些核心概念、语句及其实用技巧,适合初级到中级水平的学习者。 一、SQL基础 SQL是标准化的查询语言,分为DDL(Data Definition Language)、DML(Data...
自制SQL文整理,非开源,非完整,写得很挫,有使用时限,强烈不建议下载
SQL格式整理工具,而且还可以把SQL语句转换成VB DELPHI C# JAVA里面用的格式
在《SQL》语句整理中,我们涉及了数据库的创建与删除、表的创建与数据操作、查询语句以及聚合函数等核心概念。 首先,创建数据库是数据库管理的基础。在SQL Server 2005中,可以使用`CREATE DATABASE`语句来创建新...
sql语句整理 sql增删改查 更新数据记录 删除数据记录
标题中的“SQL数据库整理工具”指的是专门用于管理和优化SQL Server数据库的应用程序,这些工具通常包含一系列功能,旨在提升数据库性能,确保数据的准确性和一致性。SQL Server是Microsoft开发的一款关系型数据库...
### SQL 数据查询与条件筛选详解 #### 条件查询基础 在进行数据库操作时,条件查询是非常关键的一个环节。它允许我们根据特定条件从数据库表中检索数据。本篇文章将详细解析如何使用 SQL 进行条件查询,并涵盖各种...
DBA日常维护SQL整理,涵盖操作系统、存储、数据库各个层面
在SQL面试中,掌握核心概念和技术至关重要。这里我们将深入探讨SQL、Oracle、MySQL以及SQL Server等数据库相关的知识点,这些内容都是面试中常见的考察点。 1. SQL基础: - 数据库概念:理解关系型数据库的基本...
尽管描述和部分内容提供的信息有限,但我们可以基于标题“刚刚整理的SQL语句”来展开一些重要的SQL知识点,帮助读者更好地理解和掌握SQL的基础及进阶用法。 ### SQL简介 SQL(Structured Query Language)是一种...
SQL Server 面试常用 SQL 整理 在 SQL Server 面试中,数据库部分的知识是非常重要的,本文将整理一些常用的 SQL 查询语句,以便更好地应对面试。 数据库设计 在创建数据库时,需要考虑到数据库的设计,包括表...
SQL Server 2005索引碎片整理
这个压缩包“SQL整理”很可能包含了关于SQL的各种概念、语法、操作和最佳实践的详细资料。以下是一些可能涵盖在其中的重要知识点: 1. **SQL基本概念**:SQL分为DDL(Data Definition Language,数据定义语言)、...
### 一般SQL语句优化整理 #### 概述 在数据库操作中,SQL查询语句是数据检索的核心,其性能直接影响到应用系统的响应时间和资源消耗。对于一般的SQL语句优化,不仅能够提升查询效率,还能改善用户体验。本文将对...
三、SQLSERVER数据库的操作命令 查看数据库版本的命令是:select @@version。 修改数据库密码的命令是:EXEC sp_password NULL, '新的密码', 'sa'。例如:EXEC sp_password NULL, 'sa123', 'sa'。 四、SQLSERVER...
三、聚合函数 SQL提供了一些聚合函数,如COUNT()、SUM()、AVG()、MAX()和MIN(),用于对一组值进行统计计算。例如,计算`employees`表中的员工总数: ```sql SELECT COUNT(*) FROM employees; ``` 四、分组(GROUP ...