Gregory Stark escribió:

> I get this about once a day because I frequently type this ad-hoc query and
> always forget to put the alias in the first time:
> 
> postgres=# select count(*),n from (select count(*) as n from test group by i) 
> group by n;
> ERROR:  subquery in FROM must have an alias
> HINT:  For example, FROM (SELECT ...) [AS] foo.

Exactly one extra keystroke gets you a non-error answer:

alvherre=# select count(*),n from (select count(*) as n from test group by i)a 
group by n;

-- 
Alvaro Herrera                               http://www.PlanetPostgreSQL.org/
"Si quieres ser creativo, aprende el arte de perder el tiempo"

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to [EMAIL PROTECTED] so that your
       message can get through to the mailing list cleanly

Reply via email to