Re: select count(*);

Поиск
Список
Период
Сортировка
От Chris Mair
Тема Re: select count(*);
Дата
Msg-id 544af1b38f98fe02604349075f00af88@smtp.hushmail.com
обсуждение исходный текст
Ответ на select count(*);  (Marc Mamin <M.Mamin@intershop.de>)
Ответы Re: select count(*);  (Marc Mamin <M.Mamin@intershop.de>)
Список pgsql-general
> select *;
> ----------
> ERROR:  SELECT * with no tables specified is not valid
>
> select count(*);
> ----------------
> 1
>
> Is this a must? and why 1?

Hi,

regarding the "why 1" part:

I think that if we accept that

chris=> select 'foo';
 ?column?
----------
 foo
(1 row)

returns 1 row, then naturally

chris=> select count('foo');
 count
-------
     1
(1 row)

should give a count of 1...

The * might be a bit tricky, though,
since 'select *;' doesn't work.

Bye,
Chris.








В списке pgsql-general по дате отправления:

Предыдущее
От: Marc Mamin
Дата:
Сообщение: select count(*);
Следующее
От: Marc Mamin
Дата:
Сообщение: Re: select count(*);