首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > 其他数据库 >

队列置换oracle

2012-07-03 
行列置换oracle??create table sale_list(month varchar(6),sell number(11,2))insert into sale_list va

行列置换oracle

?

?create table sale_list(month varchar(6),sell number(11,2));insert into sale_list values('201101',1000);insert into sale_list values('201102',2000);insert into sale_list values('201103',3000);insert into sale_list values('201104',4000);insert into sale_list values('201105',5000);insert into sale_list values('201106',6000); commit;

?

 

?

DECODE(value, if1, then1, if2,then2, if3,then3, . . . else )

????? select

????  substrb(month,1,4),

????  sum(decode(substrb(month,5,2),'01',sell,0)) "1",    sum(decode(substrb(month,5,2),'02',sell,0)) "2",    sum(decode(substrb(month,5,2),'03',sell,0)) "3",    sum(decode(substrb(month,5,2),'04',sell,0)) "4",    sum(decode(substrb(month,5,2),'05',sell,0)) "5",    sum(decode(substrb(month,5,2),'06',sell,0)) "6"    from sale_list

    group by substrb(month,1,4);

热点排行
Bad Request.