A little fun... Part II
Many of the thoughts as to why my response "didn't help" were very close. The reason my response didn't help.....
they did not ask how to do what they needed to do, they asked a different question instead.
Here was the full response they gave me
Thanks for answering me.
This doesn’t help me, since the indexes are not sequential. (they could be : 123298, 123400,122000), and I needed some more conditions.
So I used that one instead:
from (select ...,
(lead(id,1) over (order by id)) as nextTB,
id as TB,
(lag(id,1) over (order by id)) as preTB
where ARTICLEREF in (select articleref
and status ='AP'
order by id asc)
Now, the comment about the not sequential is not relevant - the approach I took did not rely on them being sequential. I would find the max(id) less than the one of interest and get three records starting there.
But, the bit about lots of predicates and such - totally missing.
This happens a lot - questions that are so ill specified or just not even close to what they wanted to ask - it wastes both of our time (my time, their time).
One commenter hit it on the head:
Writing specifications, asking what you mean, being concise yet complete - it is so important, yet seems to be the thing most lacking in many respects. I think maybe this "agile" programming technique - the one where specifications and such are purposely "not firmed up" leads to this.