ORACLE 错误集锦

1.QQ:"ORA--00979 GROUP BY 表达式错误"\

  AN: group by 使用时必须列出所有在select 和order by后面出现的字段除了聚合函数外.

eg:

select obj.stock_type as stock_type,
  obj.stock_detail_id as stock_detail_id,
  sum(obj.qty)
  from MT_INV_STOCK obj 
 group by ,obj.stock_typ

这个就会产生00979错误,应该改成

select obj.stock_type as stock_type,
  obj.stock_detail_id as stock_detail_id,
  sum(obj.qty)
  from MT_INV_STOCK obj 
 group by ,obj.stock_typ,obj.stock_detail_id


你可能感兴趣的:(oracle)