1
我正在使用此查詢,但它不斷顯示我NULL值而不是0,我已經嘗試了很多東西,並不能讓它返回null值爲0。SQL查詢顯示NULL甚至與Isnull
select p.* from
(
select 'Ordenado Base' as Custos, nome, sum(isnull(prre.ere,0)) as OBase
from pr
inner join prre on pr.prstamp = prre.prstamp
where year(pr.data) = 2017 and prre.cr = 1
group by nome
) as Tabela1
Pivot(
sum(Tabela1.Obase)
for nome in ([Alexandra Maria da Costa Migueis],[ALEXANDRE PEDRO GOMES FREITAS],[Amílcar Leonardo dos Santos],[Ana Filipa Leitão Costa Martins Claro Viana Machado],[ANA PATRICIA FRED FILIPE]) as P
它的工作geat,謝謝! –