我是 SQL Server 的新手,我有一个问题。
我有这种观点,其中允许公式中的某些列为空。
我如何将这些空值转换为 0,因为如果它们为空,则公式的结果也将为空。
谢谢!
CREATE VIEW vwAchizitii
AS
SELECT
ac_id
,[Company]
,No
,[ContractID]
,[Seller]
,[AcquistionDate]
,[Village]
,[Commune]
,[Area]
,[PlotArea]
,[FieldNo]
,[Topo1]
,[Topo2]
,[Topo3]
,[Topo4]
,[Topo5]
,[TotalAreaSqm]
,[OwnershipTitle]
,[CadastralNO]
,[Type]
,[Price]
,[NotaryCosts]
,[LandTax]
,[OtherTaxes]
,[AgentFee]
,[CadastralFee]
,[TabulationFee]
,[CertSarcini]
,[ProcuraNO]
,(price+notarycosts+landtax+othertaxes+agentfee+cadastralfee+tabulationfee+certsarcini) as TotalCosts
,(price+notarycosts+landtax+othertaxes+agentfee+cadastralfee+tabulationfee+certsarcini)/(TotalAreaSqm/10000) as RonPerHa
,(price+notarycosts+landtax+othertaxes+agentfee+cadastralfee+tabulationfee+certsarcini)/(TotalAreaSqm/10000*FixHist) as EurPerHa
,[DeclImpunere]
,[FixHist]
,(price+notarycosts+landtax+othertaxes+agentfee+cadastralfee+tabulationfee+certsarcini)/FixHist as EurHist
,[LandStatus]
FROM
nbAchizitii