Re: Count(*) throws error

Поиск
Список
Период
Сортировка
От Rodrigo De León
Тема Re: Count(*) throws error
Дата
Msg-id 1184188891.122008.91960@d55g2000hsg.googlegroups.com
обсуждение исходный текст
Ответ на Count(*) throws error  ("Jasbinder Singh Bali" <jsbali@gmail.com>)
Список pgsql-general
On Jul 11, 4:00 pm, jsb...@gmail.com ("Jasbinder Singh Bali") wrote:
> I don't know why isn't count(*) working

Works for me:

create table tbl_concurrent(a int);
insert into tbl_concurrent values (1);
insert into tbl_concurrent values (9);
insert into tbl_concurrent values (4);

create or replace function foo() returns int as
$$
declare
  no_rows int := 0;
begin
  select into no_rows count(*) from tbl_concurrent;
  return no_rows;
end;
$$
language plpgsql;

select foo();

 foo
-----
   3


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

Предыдущее
От: aklaver@comcast.net (Adrian Klaver)
Дата:
Сообщение: Re: Count(*) throws error
Следующее
От: Bohdan.Linda
Дата:
Сообщение: Re:[GENERAL] auditing question - PARTIALY SOLVED