 <p>Maybe this - JOIN instead of subselect:</p> <pre><code>SELECT t1.week_val, CASE t1.week_val WHEN 1 THEN t2.hour_val ELSE t1.hour_val END AS hour_val FROM table_name t1 LEFT JOIN table_name t2 ON t2.week_val = t1.week_val + 1 </code></pre>