Prev: How to reorganize a tablespace within Oracle Enterprise Manager 10g
Next: Dumb Character Column
From: cate on 26 Jan 2010 15:20 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.
From: Vladimir M. Zakharychev on 27 Jan 2010 05:34 On Jan 26, 11:20 pm, cate <catebekens...(a)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
From: hughppd on 28 Jan 2010 13:44 On Jan 27, 4:34 am, "Vladimir M. Zakharychev" <vladimir.zakharyc...(a)gmail.com> wrote: > On Jan 26, 11:20 pm, cate <catebekens...(a)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 Thank you. Lead... I should have know.
From: cate on 28 Jan 2010 13:50 On Jan 27, 4:34 am, "Vladimir M. Zakharychev" <vladimir.zakharyc...(a)gmail.com> wrote: > On Jan 26, 11:20 pm, cate <catebekens...(a)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 Thank you. Lead, I should have know. Thanks again.
|
Pages: 1 Prev: How to reorganize a tablespace within Oracle Enterprise Manager 10g Next: Dumb Character Column |