On Sat, 30 Oct 2004 15:17:16 -0700, Shane Wegner
<shane-keyword-pgsql(dot)a1e0d9(at)cm(dot)nu> wrote:
> Hello,
(...)
> I want to retrieve any last names with more than 1
> occurence in the table. Under MySQL, this query does the
> trick.
> select lastname,count(*) as c from names group by lastname
> having c > 1;
>
> But under PG, it errors out
> ERROR: column "c" does not exist
>
> Is it possible to do a query like this with PostgreSQL?
select lastname,count(*) as c from names group by lastname having count(*) > 1;
HTH
Ian Barwick
barwick(at)gmail(dot)com