select staff_id ,sum(grade_id)/(select count(*) from tb_order_history group by staff_id )
from tb_order_history ,tb_feedback
where tb_order_history.feedback_id = tb_feedback.feedback_id group by tb_order_history.staff_id
```
现在因为子查询返回多行,所以报错。我想除数位置的子查询按staff_id 分组 统计返回的count(*)和父查询的staff_id 对应,该怎么办,求大神解答,多谢!!
```
创建子查询为视图,关联tb_order_history和视图,以staff_id ,sum(grade)为分组依据