Re: Count column with name 'count' returns multiple rows. Why?

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Rob Audenaerde <rob(dot)audenaerde(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Count column with name 'count' returns multiple rows. Why?
Date: 2017-08-18 11:37:15
Message-ID: 20170818113715.GC24376@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Aug 18, 2017 at 01:01:45PM +0200, Rob Audenaerde wrote:
> I don't understand why this query:
>
> select count(base.*) from mytable base;
>
> does return multiple rows.
>
> select count(1) from mytable base;
>
> returns the proper count.
>
> There is a column with the name 'count'.
>
> Can anyone please explain this behaviour?

https://www.postgresql.org/docs/9.6/static/sql-expressions.html#SQL-EXPRESSIONS-FUNCTION-CALLS
https://www.postgresql.org/docs/9.6/static/rowtypes.html#ROWTYPES-USAGE

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Igor Korot 2017-08-18 17:44:23 Results interpretation
Previous Message Rob Audenaerde 2017-08-18 11:01:45 Count column with name 'count' returns multiple rows. Why?