Aliased SubSelect in HAVING clause bug -- in progress?

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Aliased SubSelect in HAVING clause bug -- in progress?
Дата
Msg-id 200303112057.29399.josh@agliodbs.com
обсуждение исходный текст
Ответы Re: Aliased SubSelect in HAVING clause bug -- in progress?
Список pgsql-bugs
Folks,

I don't think I'm the first to report this, but:

SELECT a.id, b.type, max(b.number),
      (SELECT count(*) from c where c.b_type =3D b.type) as count_c
FROM a, b
WHERE a.id =3D b.a_id
GROUP BY a.id, b.type
HAVING count_c > 2;

Will get a:

ERROR: Attribute "count_c" not found.

It seems that subselects aliased in the SELECT clause of a GROUP BY query=
=20
cannot be referenced in the HAVING or ORDER BY clauses of any query.

I'd guess that this is being worked on for 7.4/8.0?

Thanks!

--=20
-Josh Berkus
 Aglio Database Solutions
 San Francisco

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

Предыдущее
От: Bruno Wolff III
Дата:
Сообщение: Re: performance for MIN,MAX aggregates
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Aliased SubSelect in HAVING clause bug -- in progress?