数据查询

shyming520 2008-07-31 12:04:11
table


id name status
1 小小 1
2 哈哈 2
3 嘿嘿 4
4 拉拉 3


实现成为

id name status
1 小小 优秀
2 哈哈 良好
3 嘿嘿 不及格
4 拉拉 及格



急!!!来个人帮忙下
...全文
48 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
shyming520 2008-07-31
  • 打赏
  • 举报
回复
晕 没人来了·~~`
shyming520 2008-07-31
  • 打赏
  • 举报
回复
不行。。。。看一下我的代码哪错了


select a.username,d.batchcode,
case e.datastatus
when 1 then '正确'
when 2 then '无效'
when 3 then '待查'
when 4 then '重复'
end as e.datastatus,
b.direction,c.workflowname,count(*) workload
from t_systemuserinfo a,t_workflowlog b,t_genworkflow c,t_batch d,t_companyinfotmp e
where a.systemuserid=b.userid
and b.fromwkfid=c.genworkflowid
and b.batchid=d.batchid
and b.companyid=e.companyid
and b.dotime between '2008-07-29' and '2008-07-30'
group by a.username,c.workflowname,d.batchcode,e.datastatus,b.direction
bwu851 2008-07-31
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 sdxiong 的回复:]
select id,name,
case status
when 1 then '优秀'
when 2 then '良好'
when 3 then '及格'
when 4 then '不及格'
end as status
from test
[/Quote]
sdxiong 2008-07-31
  • 打赏
  • 举报
回复
select id,name,
case status
when 1 then '优秀'
when 2 then '良好'
when 3 then '及格'
when 4 then '不及格'
end as status
from test

22,207

社区成员

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

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