raf35
February 26th, 2005, 09:45 PM
Hi Codeguru,
I am new to oracle. I have created some tables and now would like to create view but the following code generate error.
CREATE VIEW PRESCRIPTIONCOUNT
AS SELECT FIRSTNAME, D.DOCTOR_LIC_NO, D.DOCTOR_LIC_STATE, COUNT(*), MAX(PDATE)
FROM DOCTOR D, PRESCRIPTION P
WHERE D.Doctor_Lic_No = P.Doctor_Lic_No
AND D.Doctor_Lic_State = P.Doctor_Lic_State
GROUP BY FIRSTNAME, D.Doctor_Lic_No, D.Doctor_Lic_State;
The description of the error is:
ORA-00998: must name this expression with a column alias
I appreciate any help.
Thanks,
raf35
I am new to oracle. I have created some tables and now would like to create view but the following code generate error.
CREATE VIEW PRESCRIPTIONCOUNT
AS SELECT FIRSTNAME, D.DOCTOR_LIC_NO, D.DOCTOR_LIC_STATE, COUNT(*), MAX(PDATE)
FROM DOCTOR D, PRESCRIPTION P
WHERE D.Doctor_Lic_No = P.Doctor_Lic_No
AND D.Doctor_Lic_State = P.Doctor_Lic_State
GROUP BY FIRSTNAME, D.Doctor_Lic_No, D.Doctor_Lic_State;
The description of the error is:
ORA-00998: must name this expression with a column alias
I appreciate any help.
Thanks,
raf35