I am trying to find the best way to compare between rows in the same table. I wrote a self join query and was able to pull out the ones where the rates are different. Now I need to find out if the rates increased or decreased. If the rates increased, it's an issue. If it decreased, then there is no issue.
My data looks like this
ID DATE RATE
1010 02/02/2014 7.4
1010 03/02/2014 7.4
1010 04/02/2014 4.9
2010 02/02/2014 4.9
2010 03/02/2014 7.4
2010 04/02/2014 7.4
So in my table, I should be able to code ID 1010 as 0 (no issue) and 2010 as 1 (issue) because the rate went up from feb to apr.