SQL语句求助,感谢

qq_20800391 2018-11-14 04:54:37


...全文
52 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
education520 2018-11-14
  • 打赏
  • 举报
回复
select '在线面积' as tbname,(case when year(日期)=2018 and month(日期)=11 and day(日期)=1 then 在线面积 else 0 end) as '1'... from 表1
union all
select '投入面积' as tbname,(case when year(日期)=2018 and month(日期)=11 and day(日期)=1 then 在线面积 else 0 end). as '1'.. from 表2
union all
select '领料金额' as tbname,(case when year(日期)=2018 and month(日期)=11 and day(日期)=1 then 在线面积 else 0 end) as '1'... from 表3
union all
select '报废面积' as tbname,(case when year(日期)=2018 and month(日期)=11 and day(日期)=1 then 在线面积 else 0 end) as '1'... from 表4
union all
select '产出面积' as tbname,(case when year(日期)=2018 and month(日期)=11 and day(日期)=1 then 在线面积 else 0 end) as '1'... from 表5
qq_20800391 2018-11-14
  • 打赏
  • 举报
回复

项目 1
期初在线( ft²) 表1对应日期、工序的在线面积
本期投入( ft²) 表2对应日期、工序的投入面积
期末在线( ft²) 第2天的在线面积
生产量 ( ft²) 表3对应日期、工序的产出面积
报废量 ( ft²) 表5对应日期、工序的报废面积
领料金额(元) 表4对应日期、工序的领料金额




二月十六 2018-11-14
  • 打赏
  • 举报
回复
算法是什么?另外最好别贴图,不好复制写测试数据。

22,209

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 疑难问题
社区管理员
  • 疑难问题社区
  • 尘觉
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧