(SELECT stock FROM yourtable ORDER BY timestamp DESC LIMIT 1) as last_value