油款费 修车费 折旧费 运费 招待费 差旅费 佣金 销售净利 油款费:select sum(vou.FamountFor) as 油款费 from t_voucherentry as vou inner join t_account as a on vou.Faccountid = a.Faccountid
where a.Fnumber like '%521.%' and a.Faccountid = 1114
修车费:select sum(vou.FamountFor) as 修车费 from t_voucherentry as vou inner join t_account as a on vou.Faccountid = a.Faccountid
where a.Fnumber like '%521.%' and a.Faccountid = 1115
折旧费:select sum(vou.FamountFor) as 折旧费 from t_voucherentry as vou inner join t_account as a on vou.Faccountid = a.Faccountid
where a.Fnumber like '%521.%' and a.Faccountid = 1116
运费:select sum(vou.FamountFor) as 运费 from t_voucherentry as vou inner join t_account as a on vou.Faccountid = a.Faccountid
where a.Fnumber like '%521.%' and a.Faccountid = 1117
招待费:select sum(vou.FamountFor) as 招待费 from t_voucherentry as vou inner join t_account as a on vou.Faccountid = a.Faccountid
where a.Fnumber like '%521.%' and a.Faccountid = 1119
差旅费:select sum(vou.FamountFor) as 差旅费 from t_voucherentry as vou inner join t_account as a on vou.Faccountid = a.Faccountid
where a.Fnumber like '%521.%' and a.Faccountid = 1118
佣金:select sum(vou.FamountFor) as 佣金 from t_voucherentry as vou inner join t_account as a on vou.Faccountid = a.Faccountid
where a.Fnumber like '%521.%' and a.Faccountid = 1120
销售净利:(销售毛利 - 工资 - 油款费 - 修车费 - 折旧费 - 运费 - 招待费 - 差旅费 - 佣金)不用SUM这个语句怎么写到一条
where a.Fnumber like '%521.%' and a.Faccountid = 1114
修车费:select sum(vou.FamountFor) as 修车费 from t_voucherentry as vou inner join t_account as a on vou.Faccountid = a.Faccountid
where a.Fnumber like '%521.%' and a.Faccountid = 1115
折旧费:select sum(vou.FamountFor) as 折旧费 from t_voucherentry as vou inner join t_account as a on vou.Faccountid = a.Faccountid
where a.Fnumber like '%521.%' and a.Faccountid = 1116
运费:select sum(vou.FamountFor) as 运费 from t_voucherentry as vou inner join t_account as a on vou.Faccountid = a.Faccountid
where a.Fnumber like '%521.%' and a.Faccountid = 1117
招待费:select sum(vou.FamountFor) as 招待费 from t_voucherentry as vou inner join t_account as a on vou.Faccountid = a.Faccountid
where a.Fnumber like '%521.%' and a.Faccountid = 1119
差旅费:select sum(vou.FamountFor) as 差旅费 from t_voucherentry as vou inner join t_account as a on vou.Faccountid = a.Faccountid
where a.Fnumber like '%521.%' and a.Faccountid = 1118
佣金:select sum(vou.FamountFor) as 佣金 from t_voucherentry as vou inner join t_account as a on vou.Faccountid = a.Faccountid
where a.Fnumber like '%521.%' and a.Faccountid = 1120
销售净利:(销售毛利 - 工资 - 油款费 - 修车费 - 折旧费 - 运费 - 招待费 - 差旅费 - 佣金)不用SUM这个语句怎么写到一条
解决方案 »
- 关于动态创建表格,为表格中添加图片
- Oracle数据库查询问题
- 请问哪位知道用webBrowser 或AxWebBrowser怎么样显示贴子的内容吗?有没有类似的例子源码或webBrowser,AxWebBrowser的相关资料也行,能否
- clickonce的问题
- 这是怎么回事??无法生成临时类(result=1)。 error CS2001: δ???C:\WINDOWS\TEMP\oucmsx7h.0.cs error CS2008: 未指定输入
- 求助,一直在线,如何改变windows窗体的标题栏颜色?????
- 关于C#
- 网站开发过程中怎样进行开发网站维护的功能??
- DataSet导出XML的日期格式问题,请关注
- 检测CapsLock键的状态?
- Winform下子窗体移动,父窗体刷新的问题?
- 如何动态获得对象的属性值
from
(
select case a.Faccountid when 1114 then sum(vou.FamountFor) as 油款费,case a.Faccountid when 1115' then sum(vou.FamountFor) as 修车费... from t_voucherentry as vou inner join t_account as a on vou.Faccountid = a.Faccountid
where a.Fnumber like '%521.%'
)
至于那个销售净利,没看懂。呵呵
sum(a.Faccountid = 1115 then vou.FamountFor else 0 end) as 油款费2,
sum(a.Faccountid = 1116 then vou.FamountFor else 0 end) as 油款费3,
sum(a.Faccountid = 1117 then vou.FamountFor else 0 end) as 油款费4,
sum(a.Faccountid = 1118 then vou.FamountFor else 0 end) as 油款费5,
sum(a.Faccountid = 1119 then vou.FamountFor else 0 end) as 油款费6,
sum(a.Faccountid = 1120 then vou.FamountFor else 0 end) as 油款费7from t_voucherentry as vou inner join t_account as a on vou.Faccountid = a.Faccountid
where a.Fnumber like '%521.%' 懒得打字了,你把上面的中自己改吧
是要这样的吗?
create table #a
(
b int
,c int
,d int
)
insert into #a
select 1,2,1114
union
select 11,3,1114
union
select 21,3,1115
union
select 211,3,1115
union
select 2111,3,1115select
sum(c)
from
#a
where
b like '%1%'
group by d
order by d
drop table #a
sum(case when a.Faccountid = 1115 then vou.FamountFor else 0 end) as 油款费2,
sum(case when a.Faccountid = 1116 then vou.FamountFor else 0 end) as 油款费3,
sum(case when a.Faccountid = 1117 then vou.FamountFor else 0 end) as 油款费4,
sum(case when a.Faccountid = 1118 then vou.FamountFor else 0 end) as 油款费5,
sum(case when a.Faccountid = 1119 then vou.FamountFor else 0 end) as 油款费6,
sum(case when a.Faccountid = 1120 then vou.FamountFor else 0 end) as 油款费7from t_voucherentry as vou inner join t_account as a on vou.Faccountid = a.Faccountid
where a.Fnumber like '%521.%'
sorry上面写错
sum(case when a.Faccountid = 1114 then vou.FamountFor else 0 end) as '油款费',
sum(case when a.Faccountid = 1115 then vou.FamountFor else 0 end) as '修车费',
sum(case when a.Faccountid = 1116 then vou.FamountFor else 0 end) as '折旧费',
sum(case when a.Faccountid = 1117 then vou.FamountFor else 0 end) as '运费',
sum(case when a.Faccountid = 1118 then vou.FamountFor else 0 end) as '差旅费',
sum(case when a.Faccountid = 1119 then vou.FamountFor else 0 end) as '招待费',
sum(case when a.Faccountid = 1120 then vou.FamountFor else 0 end) as '佣金'
from t_voucherentry as vou inner join t_account as a on vou.Faccountid = a.Faccountid
where a.Fnumber like '%521.%'
and a.Faccountid in(1114,1115,1116,1117,1118,1119,1120)
group by 人名不行把库给我
max((en.fentryselfb0158 - en.famount) - 油款费 - 修车费 - 折旧费 - 运费 - 差旅费 - 招待费 - 运费) as 净利那几个值怎么取?