Database connection failed: Subquery returns more than 1 row