Simplified inner query