代码语言
.
CSharp
.
JS
Java
Asp.Net
C
MSSQL
PHP
Css
PLSQL
Python
Shell
EBS
ASP
Perl
ObjC
VB.Net
VBS
MYSQL
GO
Delphi
AS
DB2
Domino
Rails
ActionScript
Scala
代码分类
文件
系统
字符串
数据库
网络相关
图形/GUI
多媒体
算法
游戏
Jquery
Extjs
Android
HTML5
菜单
网页交互
WinForm
控件
企业应用
安全与加密
脚本/批处理
开放平台
其它
【
PLSQL
】
统计每个月的销量
作者:
/ 发布于
2017/2/7
/
985
select sum(case b.mm when '01' then b.weight else 0 end) as 一月, sum(case b.mm when '02' then b.weight else 0 end) as 二月, sum(case b.mm when '03' then b.weight else 0 end) as 三月, sum(case b.mm when '04' then b.weight else 0 end) as 四月, sum(case b.mm when '05' then b.weight else 0 end) as 五月, sum(case b.mm when '06' then b.weight else 0 end) as 六月, sum(case b.mm when '07' then b.weight else 0 end) as 七月, sum(case b.mm when '08' then b.weight else 0 end) as 八月, sum(case b.mm when '09' then b.weight else 0 end) as 九月, sum(case b.mm when '10' then b.weight else 0 end) as 十月, sum(case b.mm when '11' then b.weight else 0 end) as 十一月, sum(case b.mm when '12' then b.weight else 0 end) as 十二月 from ( select to_char(a.createdate,'mm') as mm,sum(a.weight) as weight from es_contractline a where to_char(a.createdate,'YYYY')='2010' group by to_char(a.createdate,'mm') )b
试试其它关键字
同语言下
.
查看某张表的表结构
.
oracle 集合操作
.
for 循环中倒序 用reverse
.
Oracle 临时表空间收缩
.
查看session及其对应运行的sql
.
Oracle常用查看表结构命令
.
Oracle Connect By Prior用法(实现递归查询)
.
重置排序 SEQUENCE
.
创建一个trigger
.
批量替换字段中的字符
可能有用的
.
查看某张表的表结构
.
oracle 集合操作
.
for 循环中倒序 用reverse
.
Oracle 临时表空间收缩
.
查看session及其对应运行的sql
.
Oracle常用查看表结构命令
.
Oracle Connect By Prior用法(实现递归查询)
.
重置排序 SEQUENCE
.
创建一个trigger
.
批量替换字段中的字符
贡献的其它代码
Label
Copyright © 2004 - 2024 dezai.cn. All Rights Reserved
站长博客
粤ICP备13059550号-3