shani19831 (8/6/2013)
HiThanks for the query, its returning what i want, but i have never used CTE and have no knowledge of it, guess its time to learn.
is there no easy way of doing it instead of the way you did it cause its so complicated.
How easy is it, say i want to join other tabes to ln and dp tables in order to display other information?
The reason is, i need extra information but its hosted in other different tables that i normally join to ln or dp.
Thank you in advance
Unless you get into recursive CTE's just think of a CTE as a sub-query in the FROM clause (known as a derived table) except it's not in the FROM clause. It's still just a "derived table" or "inline view" just like a sub-query in a FROM clause.
--Jeff Moden
Change is inevitable... Change for the better is not.