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 对应,该怎么办,求大神解答,多谢!!
```
相关问题
- Can I skip certificate verification oracle utl_htt
- how to calculate sum time with data type char in o
- keeping one connection to DB or opening closing pe
- System.Data.OracleClient not working with 64 bit O
- How can I get rid of dynamic SQL
相关文章
- node连接远程oracle报错
- oracle 11g expdp导出作业调用失败,提示丢包。
- 执行一复杂的SQL语句效率高,还是执行多少简单的语句效率高
- Oracle equivalent of PostgreSQL INSERT…RETURNING *
- Difference between FOR UPDATE OF and FOR UPDATE
- Oracle USING clause best practice
- Is there a method in PL/SQL to convert/encode text
- PHP PDO installation on windows (xampp)
创建子查询为视图,关联tb_order_history和视图,以staff_id ,sum(grade)为分组依据