Re: [HACKERS] select count(*) from : 0 rows or 1 rows ?

Поиск
Список
Период
Сортировка
От D'Arcy" "J.M." Cain
Тема Re: [HACKERS] select count(*) from : 0 rows or 1 rows ?
Дата
Msg-id m10oRCV-0000bIC@druid.net
обсуждение исходный текст
Ответ на select count(*) from : 0 rows or 1 rows ?  (Oleg Bartunov <oleg@sai.msu.su>)
Список pgsql-hackers
Thus spake Oleg Bartunov
> discovery=> select count(*) from publications;
> count
> -----
>     0
> (1 row)
> 
>   Does 1 rows is a correct result ?

Absolutely.  "SELECT COUNT(*)..." always returns exactly one row (well,
assuming that the table exists, of course) so this is correct.  A return
of zero rows would imply that no information was returned but you did
get back information here, the fact that the table is empty.

-- 
D'Arcy J.M. Cain <darcy@{druid|vex}.net>   |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 424 2871     (DoD#0082)    (eNTP)   |  what's for dinner.


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

Предыдущее
От: The Hermit Hacker
Дата:
Сообщение: Re: [HACKERS] History of PostgreSQL
Следующее
От: Horak Daniel
Дата:
Сообщение: RE: [HACKERS] report for Win32 port