相关推荐
查看7道真题和解析 点赞 评论 收藏   
分享
  点赞 评论 收藏   
分享
 10-10 20:27
  西安工业大学 运维开发工程师  
牛6666666__:select f.farm_name as farm_name,
       c.crop_name,
       c.crop_type,
       round(avg(health_index), 2)                    as avg_health_index,
       round(sum(yield_kg_per_hectare),0)                     as avg_yield_kg_per_hectare,
       datediff(max(measurement_date), min(planting_date)) as growth_days
from crop_data cd
         inner join farms f on cd.farm_id = f.farm_id
         inner join crops c on cd.crop_id = c.crop_id
where cd.measurement_date between '2024-03-01' and '2024-06-30'
group by cd.crop_id, cd.farm_id,f.farm_name
having count(cd.data_id) >= 3
order by avg_health_index desc, avg_yield_kg_per_hectare desc,farm_name 点赞 评论 收藏   
分享