473,387 Members | 1,925 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

help for operation with date

DM
Hi all,
I've a table like this:
date, value
01/01/2008, 3
01/02/2008, 4
02/03/2008, 7

and I wish to find with one query the difference (in days) from all
the consecutive intervals (01/02 - 01/01 and 02/03 - 01/02 in this
example).

Someone could help me please?
Thanks all,
DM
Mar 3 '08 #1
1 1261
DM wrote:
Hi all,
I've a table like this:
date, value
01/01/2008, 3
01/02/2008, 4
02/03/2008, 7

and I wish to find with one query the difference (in days) from all
the consecutive intervals (01/02 - 01/01 and 02/03 - 01/02 in this
example).

Someone could help me please?
Thanks all,
DM
Take a look at the OLAP functions. Especially the ROWS PRECEEDING
clause. They allow you to dip into trailing or leading rows.

Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Mar 3 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Marcus | last post by:
Hi I have a very complex sql query and a explain plan. I found there is a full table scan in ID=9 9 8 TABLE ACCESS (FULL) OF 'F_LOTTXNHIST' (Cost=84573 Card=185892...
13
by: Mike | last post by:
Normally scheduling a job is a very elementary operation but for some hidden reason I've been unable to schedule a job which runs on a 28 day cycle, even though I have at least 16 other jobs...
4
by: Joe | last post by:
I'm hosting my web service on a Windows 2003 box which is remotely located. When trying to add a web reference to a C# project I get an error message 'There was an error downloading...
22
by: settyv | last post by:
Hi, I need to write a Javascript which calculates datedifference as well as date comparision.When i try to embed the below script,it is working well,but the page is submitting even when the...
11
by: Maria Mela | last post by:
Hello everyone... Anybody can help me on this project?? Thks for your time... Requirements Information: of the Card Each card will have a set of information associated. These information...
1
by: deena22 | last post by:
Hi i'm using 'Access database' and VB 6.0. My database is named ' timesheet' and it contains a table named 'tabletimesheet'. The table contain the following fields: 'staffname, stafftype, date,...
1
by: eskelies | last post by:
Below you will find the code that I have written. I am asking it to search for an Excel file. Once it finds the correct dated Excel file it opens it. From there it is in search of information. I...
5
by: Ivan Velev | last post by:
Hello, Minimal example below - it gives me different output if I comment / uncomment the extra time.mktime call - note that this call is not related in any way to main logic flow. When...
0
by: Michael | last post by:
I know I am missing something simple, but I am stuck. When I submit the following for the employee info gets stored in scale1 and scale1 shows the employee number. Can someone show me my...
0
by: bgreer5050 | last post by:
I know I am missing something simple, but I am stuck. When I submit the following for the employee info gets stored in scale1 and scale1 shows the employee number. Can someone show me my...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.