Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Sql scripts max #5

Open
wants to merge 4 commits into
base: sql_scripts
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
SELECT id_ref_campaign_fk
FROM bi.campaign_river
WHERE river_name IN
(
SELECT DISTINCT A.river_name
FROM bi_temp.campaign_river A
INNER JOIN bi_temp.pipelines B
ON A.id_ref_campaign_fk = B.campaign_id
-- WHERE A.pipeline_id = [?current_id?] // comment on récup cet id_pipeline et sous quel format ?
)
;


-- NEXT => aller copier pour toutes ces campaign_id les data du schéma bi dans le schéma bi_temp ?
-- Sur quel périmètre ?

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
SELECT campaign_id
FROM bi_temp.pipelines
WHERE campaign_has_been_computed = True
AND river_has_been_computed = True
;

-- Puis copier pour ces campaign_id les data du schéma bi_temp dans le schéma bi (inverse du T100) ?
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
INSERT INTO bi_temp.pipelines (campaign_id)
SELECT id FROM campaign.campaign WHERE has_been_computed = Null;