BS-11476, fix wrong query (was missing parentheses)