如何计算牙医总数 [英] How to Count Total Dentist
本文介绍了如何计算牙医总数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
听到我的查询在下面给出 -
hear is my Query Given Below -
select @UnderPartA as UnderPartA
,@UnderPartB as UnderPartB
,@DentalHysenist as DentalHysenist
,@DentalMachenist as DentalMachenist
,@UnderPartA + @UnderPartB as TotalDEntist
它不起作用我想知道如何计算Total Dentist
and it is not working i want to know how to count Total Dentist
推荐答案
您无法在查询中定义变量。您需要在使用之前使用声明语句并定义变量
请尝试使用此选项
选择@UnderPartA作为UnderPartA ,@ UnderPartB作为UnderPartB,(UnderPartA + UnderPartB)作为TotalDEntist
或者,
You cannot define variables in a query. You need to use declare statements and define variables before using them
Try this instead
select @UnderPartA as UnderPartA,@UnderPartB as UnderPartB, (UnderPartA + UnderPartB) as TotalDEntist
Alternately,
Declare @UnderPartA INT,
Declare @UnderPartB INT,
Declare @SumTot INT
Declare @DentalHysenist INT
select @UnderPartA as UnderPartA,@UnderPartB as UnderPartB,@DentalHysenist as DentalHysenist,@DentalMachenist as DentalMachenist,
@SumTot = @UnderPartA + @UnderPartB;
PRINT @SumTot
这篇关于如何计算牙医总数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文