title: Trend Analysis in SQL
body: <p>I'd like to analyze trends over few weeks of data.
  For the sake of simplicity, 2 columns Date, Value
  I want to get the deviation of yesterday's value over same weekday going back for few weeks.</p>
  <p>pseudo code:</p>
  <p>select date, deviation(value) over average(value) where date = previous Monday
  from table
  where date &gt; sysdate - 35</p>
  <p>How to do this in SQL?</p>
  <p>Sorry for the silly question</p>