如何写这样的SQL语句? select 代号,sum(decode(商品,'商品1',金额)), sum(decode(商品,'商品2',金额)), sum(件数), sum(金额)from tab1group by 代号 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select 代号,decode(商品,'商品一',件数,0) as 商品一,decode(商品,'商品二',件数,0) as 商品二,sum(件数) as 件数,sum(金额) as 总金额from tablenamegroup by 代号 oracle 10.2.0.3补丁 重新配置ORCL11g的EM时遇到问题 pl/sql中怎么样合并数据 BIN开头的触发器怎么才能删除掉? 对专家们提出的SQL优化的几点质疑 ORA-06502: PL/SQL: 数字或值错误 : 字符串缓冲区太小 oracle 登录问题,还请大家赐教! oracle function 提供ORACLE Transparent GateWay的下载或资料的来领分!! ORacle 写 blob字段 出错 ,求大神指点 ORA-12560: TNS:protocol adapter error错误 一个很简单的问题???请指教,我是初学者。。。。
decode(商品,'商品二',件数,0) as 商品二,
sum(件数) as 件数,
sum(金额) as 总金额
from tablename
group by 代号