Requete invalide:with part1 as ( select case when count(*)=0 then FALSE else TRUE end as has_pedigree from pedigree_assignment inner join pedigree_definition using (model_number,pedigree_seq) where model_number=626 ) select distinct model_number,mathieu_usable as usable,facilitator,author,author_contact, model_year_start || '-' ||model_year_end as period,model_name, count(distinct group_name) as nb_group,number_groups,st_area(geom) as surf,count(distinct fleet_name) as nb_fleet,ecosim,ecospace,fao_area,country,area,mathieu_usable, mathieu_problem as remarks,dissemination,ecosystem_type,lme,has_pedigree,is_fitted,case when taxonomy.model_number is null then FALSE else TRUE end as has_taxonomy,reference,doi,url,comments_objectives from models_list inner join models_info using(model_number) inner join models_history using(model_number) LEFT join models_details using(model_number) left join fishery_fleets using(model_number) left join taxonomy using (model_number) ,part1 where model_number=626 group by is_fitted,has_taxonomy,has_pedigree,lme,ecosystem_type,model_number,mathieu_usable,facilitator,author,author_contact,period,model_name,surf,ecosim,ecospace,fao_area,country,area,mathieu_usable,remarks,number_groups,dissemination,reference,doi,url