Skip to content
Snippets Groups Projects
Commit 2b40b3aa authored by Christopher Lenke's avatar Christopher Lenke
Browse files

23.09.2024

parent 9c1c0606
No related branches found
No related tags found
No related merge requests found
-- DROP PROCEDURE christines_space.build_tree_for_sector_pg(int8);
CREATE OR REPLACE PROCEDURE christines_space.build_tree_for_sector_pg(my_sector bigint)
LANGUAGE plpgsql
AS $procedure$
BEGIN
EXECUTE 'drop table if exists processing.zwischen_sector_tree';
EXECUTE 'CREATE TABLE processing.zwischen_sector_tree as (
select uid_ from (
(select uid_ from basics.u_sector where domain_id='||my_sector||')) as d1
union
select uid_1 from basics.relation where type in (0,1) and uid_0 in (
(select uid_ from basics.u_sector where domain_id='||my_sector||'))
union
select uid_1 from basics.relation where type in (0,1) and uid_0 in (
select uid_1 from basics.relation where type in (0,1) and uid_0 in (
(select uid_ from basics.u_sector where domain_id='||my_sector||')))
union
select uid_1 from basics.relation where type in (0,1) and uid_0 in (
select uid_1 from basics.relation where type in (0,1) and uid_0 in (
select uid_1 from basics.relation where type in (0,1) and uid_0 in (
(select uid_ from basics.u_sector where domain_id='||my_sector||'))))
union
select uid_1 from basics.relation where type in (0,1) and uid_0 in (
select uid_1 from basics.relation where type in (0,1) and uid_0 in (
select uid_1 from basics.relation where type in (0,1) and uid_0 in (
select uid_1 from basics.relation where type in (0,1) and uid_0 in (
(select uid_ from basics.u_sector where domain_id='||my_sector||')))))
union
select uid_1 from basics.relation where type in (0,1) and uid_0 in (
select uid_1 from basics.relation where type in (0,1) and uid_0 in (
select uid_1 from basics.relation where type in (0,1) and uid_0 in (
select uid_1 from basics.relation where type in (0,1) and uid_0 in (
select uid_1 from basics.relation where type in (0,1) and uid_0 in (
select uid_ from basics.u_sector where domain_id='||my_sector||'))))))';
END;
$procedure$
;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment