Oracle常见函数大全(14)

  
  结构转化的SQL语句为:
  
 

 create or replace view   v_sale(year,month1,month2,month3,month4,month5,month6,     month7,month8,month9,month10,month11,month12)   as   select   substrb(month,1,4),   sum(decode(substrb(month,5,2),'01',sell,0)),   sum(decode(substrb(month,5,2),'02',sell,0)),   sum(decode(substrb(month,5,2),'03',sell,0)),   sum(decode(substrb(month,5,2),'04',sell,0)),   sum(decode(substrb(month,5,2),'05',sell,0)),   sum(decode(substrb(month,5,2),'06',sell,0)),   sum(decode(substrb(month,5,2),'07',sell,0)),   sum(decode(substrb(month,5,2),'08',sell,0)),   sum(decode(substrb(month,5,2),'09',sell,0)),   sum(decode(substrb(month,5,2),'10',sell,0)),   sum(decode(substrb(month,5,2),'11',sell,0)),   sum(decode(substrb(month,5,2),'12',sell,0))   from sale   group by substrb(month,1,4);

更多Oracle相关信息见Oracle 专题页面 ?tid=12

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/788ad2a10ca265ae1d15237f9a7d9ea9.html