Skip to content Skip to sidebar Skip to footer

Postgresql Functions

These are the type definitions provided to me create type IR as (pattern_number integer, uoc_number integer); My current progress is: create or replace function q1(pattern text, u

Solution 1:

Is it what you want?..

create or replace function q1(pattern text, uoc_threshold integer)
  returns setof IR
  as $$
  BEGIN
    RETURN QUERY
    select (select count(code) from temp where code like $1)::integer
    ,(
    select count(code) from temp where code like $1 and uoc > $2)::integer;

  END;
$$ language plpgsql;

Post a Comment for "Postgresql Functions"