I am trying to select names of employees who were born in 1985.
I am doing this but it is giving me an error.
SQL> select fname, lname, count(E#) as "total"
2 extract(year from date, dob) as "year"
3 from employee
4 where "year"=1985;
extract(year from date, dob) as "year"
*
ERROR at line 2:
ORA-00923: FROM keyword not found where expected
SQL> select fname, lname, count(E#) as "total"
2 from employee
3 where extract(year from date, dob) =1985
4 group by fname, lname;
where extract(year from date, dob) =1985
*
ERROR at line 3:
ORA-00936: missing expression
extract(year from dob)
. For details see the manual: docs.oracle.com/cd/E11882_01/server.112/e41084/…as "total"
in the 1st query - that's why it complaints about a missingFROM
.