Whew! I read this thread mostly to remind myself how lucky I am that I moved to a job that's pulling data out of the database rather than application support. "Yes, indeed, I have no problems," I congratulate myself. Then this morning I wake up suddenly at five a.m. thinking "holy crap, that last data I pulled for those very important senior executives--the data of the numbers they're using to make important business-altering decisions with--did the OVER partitition bit process before or after the WHERE clause? Because if it happened before my numbers would be wrong, so wrong, so very wrong. And it would embarrass the hell out of my boss's boss to admit that her data monkey were that incompetent, and she just fired my boss for much less."
Forty minutes later my heart rate was almost back to normal after I looked at my SQL from a month ago and saw that to make it easier on myself I'd done it all as a CTE and then used the partition's row number as the only criterion in a WHERE over the whole thing, thus bypassing the whole issue of what order the crap happened. My data is correct because I lucked out and happened to do it in a way that avoided a question I hadn't thought to ask at the time.
With support there's always so much going on mistakes are both inevitable and forgiven. A datamonkey is comfortably isolated...until he ***** up and then he's all alone in the spotlight... Ugh!