SELECT ROW_NUMBER() OVER(partition by rce.reportruncaseid ORDER BY rce.Reportruncaseid) AS Row, rce.ReportRunCaseIdAS CaseId, YEAR(rce.EcoDate) AS EcoYear
FROM PhdRpt.ReportCaseList AS rcl INNER JOINPhdRpt.RptCaseEco AS rce ON rce.Rep
SELECT cmp.ProductionMonth, cmp.ProductionAmount, rce.EcoDate, rcl.CaseCaseId, cmp.CaseCaseId ASCaseId, rce.GrossOil
FROM PhdRpt.ReportCaseList_465 AS rcl INNER JOINPhdRpt.RptCaseEco_465 AS rce ON rcl.ReportRunCaseId = rce.ReportRunCaseId RIGHT OUTER