Search Postgresql Archives

Re: Count(*) throws error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Jul 11, 4:00 pm, jsb...@xxxxxxxxx ("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



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux