diff options
| author | Martial Simon <msimon_fr@hotmail.com> | 2025-09-15 01:08:27 +0200 |
|---|---|---|
| committer | Martial Simon <msimon_fr@hotmail.com> | 2025-09-15 01:08:27 +0200 |
| commit | c9b6b9a5ca082fe7c1b6f58d7713f785a9eb6a5c (patch) | |
| tree | 3e4f42f93c7ae89a364e4d51fff6e5cec4e55fa9 /graphs/sql/outsourcing/req02.sql | |
add: graphs et rushs
Diffstat (limited to 'graphs/sql/outsourcing/req02.sql')
| -rw-r--r-- | graphs/sql/outsourcing/req02.sql | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/graphs/sql/outsourcing/req02.sql b/graphs/sql/outsourcing/req02.sql new file mode 100644 index 0000000..1c2dd3d --- /dev/null +++ b/graphs/sql/outsourcing/req02.sql @@ -0,0 +1,6 @@ +SELECT person_id,first_name,last_name,birth_date,O.created_at::date AS conviction_date,serving_time,(date '2059-12-03' <= T.created_at::date - concat(serving_time, ' month')::interval) AS could_be_released +INTO public.outcome_status +FROM justice.defendants AS D, public.people AS P, justice.trials as T, justice.outcomes AS O, justice.cases AS C +WHERE D.person_id = P.id AND D.trial_id = T.id AND T.id = O.trial_id AND T.case_id = C.id +AND O.outcome = 'GUILTY' +AND C.classification = 'CRIME' |
