Error information:
QUERY: SELECT fossil_group.option_code, fossil_group.option_name_thai as th, fossil_group.option_name_eng as en, COUNT(DISTINCT(t_fossil_master_type.fossil_master_type_id)) as count_fossil FROM t_fossil_master_type LEFT JOIN t_attachment ON t_fossil_master_type.fossil_master_type_id = t_attachment.ref_id AND t_attachment.ref_table = 't_fossil_master_type' AND t_attachment.type = 'cover_image' AND t_attachment.status = 'A' LEFT JOIN mas_option as fossil_group ON t_fossil_master_type.fossil_group = fossil_group.option_code AND fossil_group.ref_table='t_fossil' AND fossil_group.field_name = 'fossil_group' LEFT JOIN mas_fossil_type ON t_fossil_master_type.fossil_type = mas_fossil_type.fossil_type_id LEFT JOIN t_attachment as mas_fossil_type_image ON mas_fossil_type.fossil_type_id = mas_fossil_type_image.ref_id AND mas_fossil_type_image.ref_table = 'mas_fossil_type' AND mas_fossil_type_image.type = 'cover_image' AND mas_fossil_type_image.status = 'A' LEFT JOIN mas_source_name ON t_fossil_master_type.source_name_id = mas_source_name.source_name_id LEFT JOIN t_attachment as mas_source_name_image ON mas_source_name.source_name_id = mas_source_name_image.ref_id AND mas_source_name_image.ref_table = 'mas_source_name' AND mas_source_name_image.type = 'cover_image' AND mas_source_name_image.status = 'A' LEFT JOIN mas_geologic_time as period_from ON t_fossil_master_type.system_period_from = period_from.geo_time_code and period_from.geo_time_type = 'period' LEFT JOIN mas_geologic_time as period_to ON t_fossil_master_type.system_period_from = period_to.geo_time_code and period_to.geo_time_type = 'period' LEFT JOIN t_fossil_site_fossil_master_type ON t_fossil_master_type.fossil_master_type_id = t_fossil_site_fossil_master_type.fossil_master_type_id LEFT JOIN t_fossil_site ON t_fossil_site_fossil_master_type.fossil_site_id = t_fossil_site.fossil_site_id LEFT JOIN t_address ON t_address.ref_table = 't_fossil_site' and t_address.address_type LIKE 'location_%' and t_address.ref_id = t_fossil_site.fossil_site_id LEFT JOIN mas_province ON t_address.province_id = mas_province.province_id LEFT JOIN mas_geography ON mas_province.geo_id = mas_geography.geo_id LEFT JOIN t_fossil_site_terrain ON t_fossil_site.fossil_site_id = t_fossil_site_terrain.fossil_site_id LEFT JOIN mas_terrain ON t_fossil_site_terrain.terrain_id = mas_terrain.terrain_id LEFT JOIN t_fossil_geologic_group_formation ON t_fossil_geologic_group_formation.ref_table = 't_fossil_site' AND t_fossil_geologic