Query failed: ERROR: more than one row returned by a subquery used as an expression