select case when LEFT(phase_code,1)='1' then '一百章' when LEFT(phase_code,1)='2' then '二百章' when LEFT(phase_code,1)='3' then '三百章' when LEFT(phase_code,1)='4' then '四百章' when LEFT(phase_code,1)='5' then '五百章' when LEFT(phase_code,1)='6' then '六百章' end as zhang,SUM(isNull(amount,0)*isNull(price,0)) as sum1 from bargain_phase where project_id=1807 group by phase_code,full_id order by full_id
我贴过去没效果。。。麻烦大大了