Re: lag lag lag

From: Vladimir M. Zakharychev <vladimir.zakharychev_at_gmail.com>
Date: Wed, 27 Jan 2010 02:34:02 -0800 (PST)
Message-ID: <13f33d9b-dccb-48e4-9e11-28159995d6f4_at_k41g2000yqm.googlegroups.com>



On Jan 26, 11:20 pm, cate <catebekens..._at_yahoo.com> wrote:
> I picked up lag from this group a few weeks ago and ... nice stuff.
>
> Now I'm trying to create a query that contains a future date.  That
> means all the values in a row are LAG values except for the future
> date.  I can lag a field.  How can I lag all the fields?  Do you have
> to write lag(), lag(), lag()... or is there a way to lag once for
> mutiple fields?
>
> Thank you.

Depends on what you are trying to accomplish (a working example - the dataset, expected results - could be helpful.) You can only lag each column individually. The reverse of LAG is LEAD, might be possible to select the future date as lead() and the rest of the row from current cursor position.

Regards,

   Vladimir M. Zakharychev
   N-Networks, makers of Dynamic PSP(tm)    http://www.dynamicpsp.com Received on Wed Jan 27 2010 - 04:34:02 CST

Original text of this message