Invalid Identifier even when column name exist

I have created a view op_stis from bill table to populate data-block in oracle forms

create or REPLACE  VIEW op_stis AS
    select oid ,
    trunc(billdate,'dd') billdate,
    count(pid) products,
    sum(nop) Quantity,
    sum(totalpr) Sale
    from bill 
    group by trunc(billdate,'dd'),oid order by 2;

while executing the query Select * from op_stis returns desired result but executing

SELECT billdate from op_stis returns error

ORA-00904: “BILLDATE”: invalid identifier

excluding this rest columns are working fine.
I tried changing alias but it didn’t helped ,I searched online but most of solutions were to check name(which I already crosschecked several times).

my bill table:

 Name                                      Null?    Type
 ----------------------------------------- -------- ------------

 BILL_NO                                   NOT NULL NUMBER(4)
 PID                                       NOT NULL NUMBER(4)
 NOP                                                NUMBER
 PRICE                                              NUMBER(5)
 TOTALPR                                            NUMBER(15)
 BILLDATE                                           DATE
 STATUS                                             VARCHAR2(10)
 OID                                                NUMBER(4)

I am using oracle 10g


Source: oracle

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.