我有一个名为的列TotalArea,其格式为numeric (12,2).
我想让它用千位分隔符显示数字,所以当我
select TotalArea from table
Run Code Online (Sandbox Code Playgroud)
给我看一个像这样的格式1,234.00.
我怎么能这样做?谢谢!
我是SQL Server的新手,我有一个问题.
我有这个观点,其中公式中的一些列被允许为null.
我怎么能将这些空值转换为0,因为如果它们为null,则公式的结果也将为null.
谢谢!
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
Run Code Online (Sandbox Code Playgroud) 请有人帮我解决这个问题:我有这个选择:
SELECT Cast(( Isnull(price, 0) + Isnull(notarycosts, 0)
+ Isnull(landtax, 0) + Isnull(othertaxes, 0)
+ Isnull(agentfee, 0) + Isnull(cadastralfee, 0)
+ Isnull(tabulationfee, 0)
+ Isnull(certsarcini, 0) ) / ( totalareasqm / 10000 * fixhist ) AS
DECIMAL(12, 4)) AS EurPerHa
Run Code Online (Sandbox Code Playgroud)
有时我得到除零错误和我的应用程序它被阻止,直到我删除数据库的最后一行.我能以某种方式解决这个问题吗?
谢谢!