以下のクエリでは、4 行目の「LettingPercent」で「無効な列名」というエラーが発生します。ステートメントの 4 行目にある賃貸料を計算するために、lettingpercentage で返された各結果を使用したい
declare @let varchar(50)
select
CONVERT(varchar(50), InstructionLettingFee.percentage)+'%' as 'LettingPercent',
CONVERT(decimal(18,2), LettingPercent / (100 * DealFees.pddrl_TermRent)) as LettingFee
from tableOne
left outer join tableTwo LettingInstruction on LettingInstruction.ColumnOne= tableOne.ColumnOne
left outer join TableThree InstructionLettingFee on InstructionLettingFee.ColumnForOne = LettingInstruction.ColumTwo
left outer join TableFour DealFees on DealFees.ColumnOne = pDeal.ColumnOne