Corrected complex query example