Hi,
I'd like to get an array containing distinct values (always integers) form a
column in a table that is provided as a parameter. So I created this
function:
CREATE OR REPLACE FUNCTION get_distinct_values(table_name text, param_name
text)
RETURNS integer[] AS
$BODY$
DECLARE
_values integer[];
Rastislav Hudak wrote:
> I'd like to get an array containing distinct values (always
> integers) form a column in a table that is provided as a
> parameter. So I created this function:
>
> CREATE OR REPLACE FUNCTION get_distinct_values(table_name text, param_name
> text)
> RETURNS integer[] A
Ok mea maxima culpa I forgot to add an important fact:
the table I'm putting to get_distinct_values(..) in the recursive call is a
table that has just been created in the caller function (by EXECUTE 'CREATE
TABLE ' || table_name_new || '...). In the first run, the
get_distinct_values(..) obtains a
Hi,
I'd like to get an array containing distinct values (always integers) form a
column in a table that is provided as a parameter. So I created this
function:
CREATE OR REPLACE FUNCTION get_distinct_values(table_name text, param_name
text)
RETURNS integer[] AS
$BODY$
DECLARE
_values integer[];