![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
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? |
#2
| |||
| |||
|
|
On Sat, 30 Oct 2004 15:17:16 -0700, Shane Wegner shane-keyword-pgsql.a1e0d9 (AT) cm (DOT) nu> wrote: Under MySQL, this query does the trick. select lastname,count(*) as c from names group by lastname having c > 1; Is it possible to do a query like this with PostgreSQL? select lastname,count(*) as c from names group by lastname having count(*) > 1; |
![]() |
| Thread Tools | |
| Display Modes | |
| |