Subquery uses ungrouped column

Поиск
Список
Период
Сортировка
От Alex Ignatov
Тема Subquery uses ungrouped column
Дата
Msg-id 68c84834-70a5-a707-d74a-e0cde953d470@postgrespro.ru
обсуждение исходный текст
Ответы Re: Subquery uses ungrouped column  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-general

Hello!

Why the following query:

SELECT (select msc_id
              from collectors
              where id = substring(fileid from -1)
       ) msc_id
       from ip_data_records
       group by substring(fileid from -1)

gives me:

ERROR:  subquery uses ungrouped column "ip_data_records.fileid" from outer query
LINE 3:         where id = substring(fileid from -1)

but  the following query:

SELECT (select msc_id
              from collectors
              where id = fileid
       ) msc_id
       from ip_data_records
       group by fileid is working ok?

-- 
Alex Ignatov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

В списке pgsql-general по дате отправления:

Предыдущее
От: Thomas Güttler
Дата:
Сообщение: Re: Do docs miss information about timing of triggers?
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Subquery uses ungrouped column