SELECT T.id AS trial_id,case_id,classification,description
INTO public.definitive_trials
FROM justice.trials AS T, justice.cases AS C
WHERE T.case_id = C.id
AND T.status = 'FINISHED'
ORDER BY classification, case_id
