title: How to compare current value of a column with the previous value of the same column in both sql server and Oracle
body: <p>I have to compare the current value of a column with the previous value of the same column.
  My condition says something like this:
  If T1.C1 = prev T1.C1 and T1.C2 = prev T1.C2 and T1.C3 = 'somw value' then display T1.C3 as (prevT1.C3 +1)
  Can someone please let me know how can I achieve this in both sql server and oracle</p>