select AreaName,Person1,
Sum(
case BoxStuff when 1 then 1.5*TotalArea
case BoxStuff when 2 then 1.5*TotalArea
case BoxStuff when 3 then 1.5*TotalArea
case BoxStuff when 6 then 1.5*TotalArea
case BoxStuff when 7 then 1.5*TotalArea
case BoxStuff when 8 then 1.5*TotalArea
case BoxStuff when 9 then 2*TotalArea
else TotalArea
)
from table1
where date between '2002-01-01' and '2002-01-23'
group by AreaName,Perspon1
不大明白你的意思 第一个问题有什么可说的吗? select sum(table1.TotaArea) where
date between 'xxxx-xx-xx' and 'xxxx-xx-xx' and person='xxxx'
第二个问题更晕,一点也不理解你的意思了,只是猜一下
select newtotalarea = case len(totalarea) where 1 then totalarea * 2 when 3 then totalarea * 5 end from talbe1 where .....