1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| with CT_contact(CT_ident, CT_nom, CT_region) as
(select 1, 'dupond', 'occitanie' union all
select 2, 'rossi', 'corse' union all
select 3, 'abadie', 'aquitaine' union all
select 4, 'leblanc', 'occitanie' union all
select 5, 'martin', 'aquitaine' union all
select 6, 'zorglub', 'corse'
)
, PE_periode(PE_mois, PE_lib, PE_region) as
(select 1, 'janvier', 'corse' union all
select 2, 'février', 'occitanie' union all
select 3, 'mars', 'aquitaine' union all
select 4, 'avril', 'alsace'
)
select CT_nom
from CT_contact
inner join PE_periode
on PE_region = CT_region
where PE_mois = month(getdate())
order by CT_nom |
Partager