Hi
In SQL Server 2008:
I have one table, and I want to do something along the following lines:
SELECT T1.stuff, T2.morestuff from
(
SELECT code, date1, date2 from Table
) as T1
INNER JOIN
(
SELECT code, date1, date2 from Table
) as T2
ON T1.code = T2.code and T1.date1 = T2.date2
The two subqueries are exactly identical. Is there any way I can do this without repeating the subquery script?
Thanks
Karl