这是我需要更改为 SQLSERVER 2008 的示例 oracle 查询。基本上它从 table2 获取 scode 的描述,如果没有使用“case”的描述或 null 描述,则将其设为“unknown”。怎么做。
select a.scode,b.description,a.amt,a.purid
from
(select scode,ISNULL(SUM(AMOUNT),0) AS AMT,count(pur_ID)
from table1
where scode is not null
group by scode)A, table2 B WHERE A.SOURCE_CODE =+B.SOURCE