View: dbo.Payroll_Check_Payroll_Item_Distribution_With_Account_Range_View
View definition
`--Distribution view that includes summarized gl account range information. --Windowing allows the aggregations without resorting to addtional group by operations. This will allow --the query optimizer to make the most optimal plan. CREATE VIEW dbo.Payroll_Check_Payroll_Item_Distribution_With_Account_Range_View AS SELECT dbo.Payroll_Check_Payroll_Item_Distribution.* , MIN(expense__gl_account_KEY) OVER(PARTITION BY payroll_check_payroll_item_KEY) AS expense__gl_account_min , MAX(expense__gl_account_KEY) OVER(PARTITION BY payroll_check_payroll_item_KEY) AS expense__gl_account_max , MIN(liability__gl_account_KEY) OVER(PARTITION BY payroll_check_payroll_item_KEY) AS liability__gl_account_min , MAX(liability__gl_account_KEY) OVER(PARTITION BY payroll_check_payroll_item_KEY) AS liability__gl_account_max FROM dbo.Payroll_Check_Payroll_Item_Distribution`