SONAR-3755 Fix query for MySQL