Fix ambiguous SQL when using UserId.