Recursive SQL, have the last three values increased?

Posted by Mike on Stack Overflow See other posts from Stack Overflow or by Mike
Published on 2010-05-04T06:22:15Z Indexed on 2010/05/04 6:28 UTC
Read the original article Hit count: 153

Filed under:
|
|

Hi,

I have a table that looks like this:

----------------------
| DateTime   | Value |
----------------------
| 2010-01-01 |   26  |
| 2010-02-01 |   24  |       
| 2010-03-01 |   23  |
| 2010-04-01 |   28  |
| 2010-05-01 |   30  |

I need to find if the last three consecutive months have increased in value.

How can I get SQL to check whether the value for each has increased? If anyone can give me any pointers for solving this problem it would be greatly appreciated!

Thanks

© Stack Overflow or respective owner

Related posts about sql

Related posts about recursive