functional.sqlite.test_2f7170d73b. Error "misuse of aggregate" raising if aggregate column in FROM subquery presents in the correlated subquery