Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
open-source
OSE
Commits
ec3801dd
Commit
ec3801dd
authored
Dec 02, 2021
by
Antony Le Courtes
Browse files
Correction MV_INTERVENANT sur double téléphone pro
parent
1767232f
Changes
1
Hide whitespace changes
Inline
Side-by-side
doc/Connecteurs-Import/Octopus/MV_INTERVENANT.sql
View file @
ec3801dd
...
...
@@ -72,10 +72,12 @@ WITH i AS (
--Trouver le tel pro principal de l'intervenant
telephone_pro_principal
AS
(
SELECT
indtel
.
individu_id
individu_id
,
tel
.
numero
numero
FROM
octo
.
individu_telephone
@
octoprod
indtel
JOIN
octo
.
telephone
@
octoprod
tel
ON
(
tel
.
id
=
indtel
.
telephone_id
AND
tel
.
t_principal
=
'O'
)
SELECT
indtel
.
individu_id
individu_id
,
MAX
(
tel
.
numero
)
keep
(
DENSE_RANK
FIRST
ORDER
BY
tel
.
type_id
ASC
)
numero
FROM
octo
.
individu_telephone
@
octoprod
indtel
JOIN
octo
.
telephone
@
octoprod
tel
ON
(
tel
.
id
=
indtel
.
telephone_id
AND
tel
.
t_principal
=
'O'
)
GROUP
BY
indtel
.
individu_id
),
--Trouver la structure d'affectation principale de l'intervenant
structure_principale_individu
AS
(
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment