SQL_Surfer (7/28/2013)
Can you give me some pointers of rewriting this query? Can data be grabbed at 1 shot instead of doing UNION ALL.
I think so. Post the whole query and we'll see.
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]