CE-340 Simplifying query
Merge pull request #2701 from Wikia/CE-340-sql-query-fix

CE-340 Simplifying query