SELECTp_type, year, values,LAG (values, 1) OVER (PARTITION BY p_typeORDER BY year) prev_year_valueFROM orders_comb;