Better inner query for model status using PARTITION BY.