Small changes to the query

I cannot easily understand this one.