[GENERAL] Count column with name 'count' returns multiple rows. Why?

2017-08-18 Thread Rob Audenaerde
Hi all, 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? Steps to reproduce: create tab

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

2017-08-18 Thread Justin Pryzby
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'

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

2017-08-18 Thread Peter J. Holzer
On 2017-08-18 06:37:15 -0500, Justin Pryzby wrote: > 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; > > > >

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

2017-08-18 Thread Justin Pryzby
On Fri, Aug 18, 2017 at 10:47:37PM +0200, Peter J. Holzer wrote: > On 2017-08-18 06:37:15 -0500, Justin Pryzby wrote: > > 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; > > > > > > doe

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

2017-08-18 Thread David G. Johnston
On Fri, Aug 18, 2017 at 1:47 PM, Peter J. Holzer wrote: > So apparently > ​ ​ > columnname open-parenthesis tablename closed-parenthesis is a specific > syntactic construct, but I can't find it documented anywhere. ​The documentation linked to speaks mainly in terms of "composite types". A tabl

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

2017-08-19 Thread Peter J. Holzer
On 2017-08-18 15:57:39 -0500, Justin Pryzby wrote: > On Fri, Aug 18, 2017 at 10:47:37PM +0200, Peter J. Holzer wrote: > > On 2017-08-18 06:37:15 -0500, Justin Pryzby wrote: > > > On Fri, Aug 18, 2017 at 01:01:45PM +0200, Rob Audenaerde wrote: > > > > Can anyone please explain this behaviour? > > >