carto_enstec:questions_exploration
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| carto_enstec:questions_exploration [2017/09/28 14:39] – créée valamercery | carto_enstec:questions_exploration [2018/09/28 15:52] (Version actuelle) – valamercery | ||
|---|---|---|---|
| Ligne 8: | Ligne 8: | ||
| Comment procéder si je veux rechercher tous les établissements d' | Comment procéder si je veux rechercher tous les établissements d' | ||
| + | |||
| + | ===== Essai d' | ||
| + | |||
| + | Requête générique : trouver une institution avec un statut et une activité | ||
| + | |||
| + | |||
| + | <code sql> | ||
| + | -- essai sans association au projet | ||
| + | WITH | ||
| + | statut as | ||
| + | ( | ||
| + | SELECT | ||
| + | object_label, | ||
| + | fk_associated_object, | ||
| + | fk_type_role, | ||
| + | fk_information | ||
| + | FROM | ||
| + | bhp.information_role | ||
| + | WHERE | ||
| + | fk_associated_object = ' | ||
| + | AND | ||
| + | fk_type_role = 140 | ||
| + | ), | ||
| + | activite as | ||
| + | ( | ||
| + | SELECT | ||
| + | object_label, | ||
| + | fk_associated_object, | ||
| + | fk_type_role, | ||
| + | fk_information | ||
| + | FROM | ||
| + | bhp.information_role | ||
| + | WHERE | ||
| + | fk_associated_object = ' | ||
| + | AND | ||
| + | fk_type_role = 131 | ||
| + | ) | ||
| + | SELECT | ||
| + | ir.object_label as institution, | ||
| + | statut.object_label as statut, | ||
| + | activite.object_label as activité | ||
| + | FROM | ||
| + | bhp.information_role ir, | ||
| + | statut, | ||
| + | activite | ||
| + | WHERE | ||
| + | statut.fk_information = activite.fk_information | ||
| + | AND | ||
| + | activite.fk_information = ir.fk_information | ||
| + | AND | ||
| + | ir.is_information_subject IS TRUE | ||
| + | ORDER BY | ||
| + | ir.object_label | ||
| + | </ | ||
| + | |||
carto_enstec/questions_exploration.1506602391.txt.gz · Dernière modification : de valamercery
