Select t1.AccountNumber
, t1.originalBilledAmount / t3.ProcRecords As AdjBilledAmt
, t2.PatientPrimaryKey
, PhysicianID
, t2.cptcode
From tbl_BillingMaster t1
Inner Join tbl_PerformedProcedure t2
On t1.PatientPrimaryKey = t2.PatientPrimaryKey
Inner Join
(Select t1.AccountNumber
, Cast(Count(*) As decimal) As...