请帮我将此查询转换为SQL Server 2012. SQL Server 2012不支持运算符=*
:
select
Sum(ISNULL(Qty_Recd,0.00)) as Qty_Recd, a.PR_Detail_Key
from
PO_Dely c, PO_Tracking1 a
where
c.PO_Key =* a.PO_Key
and PR_No = '123456'
and a.File_Type = 72
and c.File_Type = 72
group by
a.PR_Detail_Key
order by
a.PR_Detail_Key
答案 0 :(得分:0)
您想要转移到显式连接语法。试试这个:
select
Sum(ISNULL(Qty_Recd,0.00)) as Qty_Recd
, a.PR_Detail_Key
from PO_Dely as c
right outer join PO_Tracking1 as a
on c.PO_Key = a.PO_Key
where PR_No = '123456'
and a.File_Type = 72
and c.File_Type = 72
group by a.PR_Detail_Key
order by a.PR_Detail_Key