The Default LAG

  • Comments posted to this topic are about the item The Default LAG

  • I had to look it up - I don't use LAG very often, and whenever I would use it, I'd have to look it up anyway.  I don't know the options it has by memory.  Just like CONVERT - I don't remember what all the format numbers are, and I want to double-check my memory for those that I might remember.

    Still, one of the options is "around the 1" in the LAG - there isn't a 1 in the question.  But it's the default value.  I guess those who use LAG a lot would know that.

    I would have been tempted to use the COALESCE around the LAG option (implying using a 0 as the 2nd parameter), but when I look it up it says that the first parameter of LAG cannot be an analytic function, so that is out.

     

     

     

  • Hunh, learn something new all the time. I'd never used or even heard of this function. I tried to answer it with what is in my head. (I think that's the spirit of the process.) Thanks for the question and it turned into a tip for me.

    -RD

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply