I have a query like this:
SELECT LINE1,LINE2,LINE3,DATE_START,DATE_CLOSE,RESULT FROM TABLE1 order BY LINE1,DATE_START;
i need to add an additional column that have too posible results: valid, invalid.
The results depends the on a comparison between the actual line and the next line. For example: suppose that I have a row that the LINE2 value is CAR and the next row the LINE1 value is CAR. Then this additional column value will be valid, else is invalid. The comparison that i need is for each line compare any column value from this line to any column value on the next line, then evaluate and set the value of the additional column