摘要:
问题:jsmonth,bosscode,rewarditemid,TelNo,rewardsum这5个字段都相同即可确定这两行是重复的记录,但是计算的时候又必须用到这一行的datetime这个字段于是,首先使用select distinct jsmonth,bosscode,rewarditemid... 阅读全文
摘要:
"> Pages/Channel/InfoReleaseView.aspx?ID=&valRead=" style="color: ;" target="_blank"> ; margin-right: 5px"> 阅读全文
摘要:
select cardno,planname,ROW_NUMBER() over(partition by cardno,planname order by createtime asc) as rowfrom CardAddrBlack即:将cardno,planname看作一个分组,以他们内部的... 阅读全文
摘要:
原表格:V_ChannelReward结构为:select * from V_ChannelReward pivot (max(RewardSum) for RewardItem in ([星级奖励],[自建空充酬金],[首充酬金],[BOSS待办酬金],[激活酬金],[神州行上网套餐拓展酬金],[... 阅读全文
摘要:
表格ChannelReward和表格RewardSuppleSettle中都有一下几个字段JSMonth, ChannelNo, RewardSum, RewardItem。要将两个表中RewardSum>0的记录都显示在一个表中,可以使用联合查询select * from(SELECT JSMon... 阅读全文
摘要:
①、select v.ZoneName,v.EmpName as 渠道经理,v.AreaName,count(1) as 销量,count(distinct ChannelNo) as 参与网点数,(select count(1)from(select ChannelNo,C=count(1) from V_IMEISale v1 where ZoneName='潮安' and AreaName='潮安南片'and EmpName=v.EmpName and RegisterTime between '2014-03-01' and '2 阅读全文