Re: [GENERAL] number of not null arguments

2010-11-26 Thread Pavel Stehule
Hello this function doesn't exists, but you can you to write (min PostgreSQL 8.4) create or replace function notnull_count(variadic anyarray) returns int as $$select count(x)::int from unnest($1) g(x)$$ language sql; it working just for scalar types: pavel=# SELECT notnull_count(1, 1, NULL, NU

[GENERAL] number of not null arguments

2010-11-26 Thread Murat Kabilov
Hello, Is there a function which returns number of not null arguments? SELECT notnull_count(1, 1, NULL, NULL) notnull_count --- 2 SELECT notnull_count(ARRAY[1,2,3], ARRAY[10,20,30], NULL, ARRAY[NULL]) notnull_count --- 3 Thanks -- Murat Kabil