Add find_opinions.sql
This commit is contained in:
19
src/main/resources/sql/functions/opinion/find_opinions.sql
Normal file
19
src/main/resources/sql/functions/opinion/find_opinions.sql
Normal file
@@ -0,0 +1,19 @@
|
||||
create or replace function find_opinions(out resource json)
|
||||
language plpgsql as
|
||||
$$
|
||||
begin
|
||||
select json_agg(t)
|
||||
into resource
|
||||
from (
|
||||
select ol.*
|
||||
from opinion_list ol
|
||||
where ol.deleted_at <= now()
|
||||
or ol.deleted_at is null
|
||||
order by ol.name
|
||||
) t;
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists find_opinions();
|
||||
|
||||
-- select find_opinions();
|
||||
Reference in New Issue
Block a user