Hi:
I am pretty new to MySQL. We are using MySQL 4.1.5 to write queries and incorporate them into Crystal Reports.
Is there a 'Next' or 'Previous' function in MySQL? I have not found anything. I have a table like the following:
Date1 | Date2 | Value
=================================
02/01/06 | 01/15/06 | 35
02/01/06 | 01/20/06 | 38
02/01/06 | 03/20/06 | 41
...
What I need is (using the second line as an example):
If (Date2 < Date1) Then MyAnswer = Previous(Value) = 35.
How do I write a query statement to get the previous value?
Can this be done using stored procedures?
Thanks in advance.
- SB
I am pretty new to MySQL. We are using MySQL 4.1.5 to write queries and incorporate them into Crystal Reports.
Is there a 'Next' or 'Previous' function in MySQL? I have not found anything. I have a table like the following:
Date1 | Date2 | Value
=================================
02/01/06 | 01/15/06 | 35
02/01/06 | 01/20/06 | 38
02/01/06 | 03/20/06 | 41
...
What I need is (using the second line as an example):
If (Date2 < Date1) Then MyAnswer = Previous(Value) = 35.
How do I write a query statement to get the previous value?
Can this be done using stored procedures?
Thanks in advance.
- SB