See if this'll work:SELECT a.ClaimCode , a.Clm_Desc , COUNT(b.claim_code) 'GrossClaimCount' , SUM(b.claim_amount) 'GrossClaimSum' , COUNT(CASE WHEN b.inv_status = 1 THEN b.claim_code ELSE null END) 'OnHoldCount' , SUM(CASE WHEN b.inv_status = 1 THEN b.net_amount ELSE 0 END) 'OnHoldSum' , COUNT(CASE WHEN b.inv_status = 0 THEN b.claim_code ELSE null END) 'InvoicedCount' , SUM(CASE WHEN b.inv_status = 0 THEN b.net_amount ELSE 0 END) 'InvoicedSum'FROM Claim_info a JOIN <Table 2 name> b ON a.ClaimCode = b.ClaimCodeGROUP BY a.ClaimCode, a.Clm_Desc