Re: select count(*);

From: Geoff Winkless <pgsqladmin(at)geoff(dot)dj>
To: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: select count(*);
Date: 2015-06-11 14:20:43
Message-ID: CAEzk6fd4K_-QaKXGoS5ZADNsWMSbXg4YRqUma3t0XfHQrXPBqw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 11 June 2015 at 15:17, Marc Mamin <M(dot)Mamin(at)intershop(dot)de> wrote:

> >But COUNT(*)
> >
> >does have meaning - it means "the number of rows".
>
> which rows? :-)

​The number of rows in the query, as well you know :)

The reason you can't SELECT *; is because there's no way of defining what
"*" refers to in this instance. You don't *need* to define what (*) is in
order to tell that there's exactly one row in it.

Geoff

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2015-06-11 14:27:08 Re: select count(*);
Previous Message Marc Mamin 2015-06-11 14:17:17 Re: select count(*);