Update test
set test.money=a.money
from (select
case
when mytime.count<=10 and mytime.count >0 then mymoney.money1
when mytime.count<=20 and mytime.count >0 then mymoney.money2
when mytime.count<=30 and mytime.count >0 then mymoney.money3
when and mytime.count>30 or and mytime.count <0 then =0
else mymoney.money4
end
from mytime,mymoney)a
set test.money=a.money
from (select
case
when mytime.count<=10 and mytime.count >0 then mymoney.money1
when mytime.count<=20 and mytime.count >0 then mymoney.money2
when mytime.count<=30 and mytime.count >0 then mymoney.money3
when and mytime.count>30 or and mytime.count <0 then =0
else mymoney.money4
end
from mytime,mymoney)a
解决方案 »
- 一道关SQL查询select的问题,求解
- SQL存储结果问题。急!!!!在线等
- 如何实现某个列,可以为null,但是只要不为空,就必须是惟一的.如何设置呀?我无论如何也设置不出来.
- xp2上安装sql server 2000 出现错误!!!
- Login failed for user
- SQL老是自动停止 该怎么解决 查询 DBCC CHECKDB 显示下列错误提示 ,高手们给些建议哈 谢谢
- 我的SQL2000为什么老是自动down了?
- 大量数据,用数据库好,还是重新设计一种算法用来存储和查找?()
- 请问sql server的优点和缺点是什么?她的规格是多少?
- 求助:有关两个表的查询的问题
- 先排序,然后根据排序内联怎么做?比如……
- .....from t_conon a left join .......疑惑
改一下:
set test.money=a.money
from (select
case
when mytime.count<=10 and mytime.count >0 then mymoney.money1
when mytime.count<=20 and mytime.count >0 then mymoney.money2
when mytime.count<=30 and mytime.count >0 then mymoney.money3
when and mytime.count>30 then mymoney.money4
else 0
end
from mytime,mymoney)a
when mytime.count between 11 and 20 then mymoney.money2
when mytime.count between 21 and 30 then mymoney.money3
when mytime.count>30 then mymoney.money4
else 0 end
set test.money=a.money
from (select
case
when mytime.count<=10 and mytime.count>0 then mymoney.money1
when mytime.count<=20 and mytime.count>0 then mymoney.money2
when mytime.count<=30 and mytime.count>0 then mymoney.money3
when mytime.count>30 then mymoney.money4
else 0
end
from mytime,mymoney)a
set test.money=a.money
from (select
case
when mytime.count<=10 and mytime.count >0 then mymoney.money1
when mytime.count<=20 and mytime.count >0 then mymoney.money2
when mytime.count<=30 and mytime.count >0 then mymoney.money3
when mytime.count>30 then mymoney.money4
else 0
end
from mytime,mymoney)a
case mytime.count
when mytime.count<=10 then mymoney.money1
when mytime.count<=20 then mymoney.money2
when mytime.count<=30 then mymoney.money3
else mymoney.money4
end
else 0==>case when mytime.count>0 then (case mytime.count
when mytime.count<=10 then mymoney.money1
when mytime.count<=20 then mymoney.money2
when mytime.count<=30 then mymoney.money3
else mymoney.money4
end ) else 0 end