ORA-00904 "Invalid identifier” for an identifier in a group by clause

前端 未结 2 1576
别那么骄傲
别那么骄傲 2020-12-11 07:47

with compiere database i am trying ro show

between two dates.

column:

designation

qty sale (depot) client sales

qty-sale

2条回答
  •  青春惊慌失措
    2020-12-11 08:15

    The problem is (at least) in the group by clause. Oracle does not allow column aliases in group by. You can readily fix this with a subquery:

    select t.*
    from (select . . .
          from . . .
          where . . .
         ) t
    group by . . . 
    order by . . . ;
    

    In other words, put everything but the group by and order by in a subquery. Then put those clauses in the outer query.

提交回复
热议问题