NineIron - Monday, February 26, 2018 12:00 PM
"idx_income" is an odd name for a heap! Why don't you have a clustered index? What's the purpose of this table? What's its daily/weekly cycle of changes?
And what Jeff said too - this is wildly different from your trivial original query.
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]