Re: SQL feature requests - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: SQL feature requests
Date
Msg-id 20070823173810.GC31461@alvh.no-ip.org
Whole thread Raw
In response to Re: SQL feature requests  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-hackers
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"


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [COMMITTERS] pgsql: Add configure option --with-system-tzdata to use operating system
Next
From: Tom Lane
Date:
Subject: Re: [COMMITTERS] pgsql: Add configure option --with-system-tzdata to use operating system