小弟 正在进行中 未出茅庐 但知道自己的不足 代码的单一没有技术亮点 求大神指点一二

ljzgchm 2017-02-02 07:20:46

select *from dates
select years,
case
when ams='1.1' and years='1991' then '1.1'
when ams='2.1' and years='1992' then '2.1'
end as m1,
case
when ams='1.1'and years='1991' then '1.2'
when ams='2.1' and years='1992' then '2.2'
end as m2,
case
when ams='1.1'and years='1991' then '1.3'
when ams='2.1' and years='1992' then '2.3'
end as m3,
case
when ams='1.1'and years='1991' then '1.4'
when ams='2.1' and years='1992' then '2.4'
end as m4
from dates where ams='1.1'or ams='2.1'
...全文
426 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
csdn967 2017-03-23
  • 打赏
  • 举报
回复
汉字鼠标书写输入就需要大数据和数据库技术:到 scdn967 下载地址:http://download.csdn.net/detail/csdn967/9790413

下载玩玩就知道: 【鼠写】汉字输入的核心技术与原理!! 完整全面展示

对编程理念拓展绝对大有帮助!

二月十六 2017-02-02
  • 打赏
  • 举报
回复
卖水果的net 2017-02-02
  • 打赏
  • 举报
回复

select  years,
  max(case when month = '1' then amount else 0 end ) as m1,
  max(case when month = '2' then amount else 0 end ) as m2,
  ....

from dates 
where...
group years

6,129

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 新技术前沿
社区管理员
  • 新技术前沿社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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