'ERROR: subquery must return only one column width many SELECT
Multi SELECT in PostgreSQL return this poroblem :(
SELECT date::date,
(
SELECT concat_ws(' ', user_cards.last_name, user_cards.first_name, user_cards.father_name),
(SELECT MIN(start_time) FROM calls_moizvonki WHERE user_account = user_cards.email AND answer_time::date=date AND answered=1) AS start_day,
(SELECT COUNT(*) FROM calls_moizvonki WHERE user_account = user_cards.email AND answer_time::date=date AND answered=1) AS calls,
(SELECT AVG(duration) FROM calls_moizvonki WHERE user_account = user_cards.email AND answer_time::date=date AND answered=1 AND duration>10) AS duration
FROM user_cards
)
FROM generate_series(
'2022-01-20%'::date,
'2022-01-24'::date,
'1 day'::interval
) date;
ERROR: subquery must return only one column width many
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
