Re: "SELECT FROM foo" acts like "SELECT COUNT(*) FROM foo"?

2023-02-01 Thread David G. Johnston
On Wednesday, February 1, 2023, Ron wrote: > > > https://www.postgresql.org/docs/12/sql-select.html > > The docs say that one of these are required in the SELECT list. > > [ * | *expression* [ [ AS ] *output_name* ] [, ...] ] > > The square brackets you show are how optional elements are introduce

Re: "SELECT FROM foo" acts like "SELECT COUNT(*) FROM foo"?

2023-02-01 Thread Tom Lane
Ron writes: > v12.13 > https://www.postgresql.org/docs/12/sql-select.html > The docs say that one of these are required in the SELECT list. > [ * |/|expression|/ [ [ AS ]/|output_name|/ ] [, ...] ] Really? I don't see anything to that effect in either the syntax synopsis or the text, plus th

Re: "SELECT FROM foo" acts like "SELECT COUNT(*) FROM foo"?

2023-02-01 Thread David G. Johnston
On Wednesday, February 1, 2023, Ron wrote: > > test=# select from sales_detail; > -- > (11 rows) > It returned 11 rows as per the psql output text, if it acted like count(*), an aggregate, it would have only returned one row. You have produced an 11-row, 0-column, output table. It isn’t “supp

Re: "SELECT FROM foo" acts like "SELECT COUNT(*) FROM foo"?

2023-02-01 Thread Rodrigo Luna
SELECT COUNT(*) FROM table_name WHERE condition; Rodrigo Dev Visite: https://rodrigoluna.net.br YouTube: YouTube.com/@gamesbrs > Em 1 de fev. de 2023, à(s) 17:00, Ron escreveu: > >  v12.13 > > https://www.postgresql.org/docs/12/sql-select.html > > The docs say that one of thes

"SELECT FROM foo" acts like "SELECT COUNT(*) FROM foo"?

2023-02-01 Thread Ron
v12.13 https://www.postgresql.org/docs/12/sql-select.html The docs say that one of these are required in the SELECT list. [ * |/|expression|/ [ [ AS ]/|output_name|/ ] [, ...] ] However, *not* mentioning anything also works, though acts like COUNT(*). test=# select * from sales_detail;  cus