第一次发帖求助 求大神来帮忙啊
select
s_zhgl_jihua.sjje,
s_zhgl_Office_procurement2.zj,
s_zhgl_Vehicle_expenses.hj,
s_zhgl_meeting.actual_cost,
s_zhgl_Send_meal.sjje,
s_zhgl_jihua.type,
s_zhgl_jihua.sum(year_jihua) as year_jihua,
s_zhgl_jihua.sum(months_jihua) as months_jihua,
s_zhgl_jihua.sum(sum_jihua) as sum_jihua
from s_zhgl_jihua
left join s_zhgl_Office_procurement2 on s_zhgl_jihua.months=s_zhgl_Office_procurement2.months
inner join s_zhgl_Vehicle_expenses on s_zhgl_Office_procurement2.months=s_zhgl_Vehicle_expenses.month
inner join s_zhgl_meeting on s_zhgl_Vehicle_expenses.month=to_char(s_zhgl_meeting.reghumdate,'mm')
inner join s_zhgl_Send_meal on to_char(s_zhgl_meeting.reghumdate,'mm')=to_char(s_zhgl_Send_meal.reghumdate,'mm')
group by s_zhgl_jihua.type
老是报错 运行在oracle数据库中 报错SELECT子句错误:"SUM"附近的表达式。缺少FROM子句。
小弟才入手 看不出来哪里有错 求各路大神帮忙
------解决方案--------------------s_zhgl_jihua.sum(year_jihua) as year_jihua,类似的这些应该写成
sum(s_zhgl_jihua.year_jihua) as year_jihua,
------解决方案--------------------查询的列需要包含到group by 语句中
------解决方案--------------------最后改成group by s_zhgl_jihua.type,s_zhgl_jihua.sjje...等等,自己补上,把前面没用聚合函数并且查询出来的列都写进去