$ 0 0 I am optimizing an inline table-valued function that performs calculations by heavily using OVER, LEAD and LAG. At one stage, records are doubled by performing a UNION. My statement can be schematized as:WITH Q1