select p.id comperitorId,p.compcorp competitorName,
sum(case when c.kindname = 'ATM' then c.num else 0 end) atm,
sum(case when c.kindname = 'CRS' then c.num else 0 end) crs,
sum(case when c.kindname = 'VTM' then c.num else 0 end) vtm,
sum(case when c.kindname = '清分机' then c.num else 0 end) sorter,
sum(case when c.kindname = '软件' then c.num else 0 end) software,
sum(case when c.kindname = '其它' then c.num else 0 end) other,
m.iscommunication iscommunication
from compproduct c
join competitor p on c.competitor_id=p.id
join (select f.custid,t.companyid,t.iscommunication from technologycompany t join technology_flow f on f.id=t.flowid) m on c.competitor_id=m.companyid and c.cust_id=m.custid
where c.cust_id='7649'
group by p.id,c.competitor_id,p.compcorp,m.iscommunication
分享到:
相关推荐
获取oracle 表字段,表名,以及主键之类等等的信息,获取oracle 表字段,表名,以及主键之类等等的信息获取oracle 表字段,表名,以及主键之类等等的信息获取oracle
oracle截取表字段中带分号的信息的存储过程
oracle变更数据表字段类型 ,简单易懂方便快捷!
oracle表字段或是视图字段添加备注方法
描述一些用数据字典内容查询表结构的内容,使用简单的SQL可以方便的查询所要的内容
Oracle数据库中,表中已存在数据字段修改该字段的长度,如有疑问可沟通联系,当积分自动提升到很高的时候欢迎联系,会把积分调低。
获取ORACLE 表字段,表名,以及主键之类等等的信息 基本开发中要用的信息都能取到了.
添加字段的语法:alter table tablename add (column datatype [default value][null/not null],….); 修改字段的语法:alter table tablename modify (column datatype [default value][null/not null],….);...
oracle 根据时间段做报表统计 SQL是时间段统计 SQL原句
mysql与oracle 表字段定义比较,了解两个数据库区别
可将oracle中表名 表注释 字段类型 字段长度 字段注释 导出为excel,生成的数据库表index sheet页面 可进行表sheet之间的跳转
根据数据库表字段自动生成javaBean工具(支持Mysql,Oracle) , 能够智能开启驼峰标识 ,操作非常简单, 包含使用教程
主要介绍了Oracle数据库按时间进行分组统计数据的方法,同时附带了一个在不同时间段内的统计实现,需要的朋友可以参考下
获取表字段: select * from user_tab_columns where Table_Name='\u7528\u6237\u8868' order by column_name 获取表注释: select * from user_tab_comments where Table_Name='\u7528\u6237\u8868' order by ...
Oracle存储过程优化思路以及思路下优化效果比较
将此脚本复制,输入表名执行可直接获得所有本表字段。
oracle的按月统计sql..............................
oracle 查询列最大值,例如有n例值,但是要找出这些列中的最大值。