MySQL Forums
Forum List  »  MySQL Query Browser

Single column row calculations
Posted by: David Raider
Date: February 02, 2012 07:09AM

Hi,

I hope I'm in the right place as this is my first post. I've searched and searched but cannot find an answer. Hopefully, someone can help.

I have a database (database) and table (table) with two columns: TIME | PRICE. Price goes up and down all day.

TIME PRICE
12:01:01 100.25
12:01:01 100.00
12:01:01 100.25
12:01:01 100.50
12:01:01 100.75
12:01:01 100.50
12:01:01 100.75
12:01:01 100.75
12:01:01 101.00

I'm trying to write a query that goes though column "PRICE" and searches for blocks of rows where there is a difference >= 1. In this case, it would show me the second row down until the last row, since 101 - 100 = 1. There's a part B to this but this would be an enormous help for now.

Thanks.

Options: ReplyQuote


Subject
Written By
Posted
Single column row calculations
February 02, 2012 07:09AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.