SQL plus 中的这个命令有什么问题?
我想统计员工人数
SQL> select count(ename) AS number of people, from emp;
select count(ename) AS number of people, from emp
*
ERROR at line 1:
ORA-00923: FROM keyword not found where expected
SQL>
这是我的表格
SQL> select ename from emp;
ENAME
----------
KING
BLAKE
CLARK
JONES
MARTIN
ALLEN
TURNER
JAMES
WARD
FORD
SMITH
ENAME
----------
SCOTT
ADAMS
MILLER
14 rows selected.
SQL>
I want to count the number of employees
SQL> select count(ename) AS number of people, from emp;
select count(ename) AS number of people, from emp
*
ERROR at line 1:
ORA-00923: FROM keyword not found where expected
SQL>
Here's my table
SQL> select ename from emp;
ENAME
----------
KING
BLAKE
CLARK
JONES
MARTIN
ALLEN
TURNER
JAMES
WARD
FORD
SMITH
ENAME
----------
SCOTT
ADAMS
MILLER
14 rows selected.
SQL>
删除 FROM 子句之前的逗号。另外,字段名称中不能有空格,请使用下划线。
此外,将关键字大写也是一个好习惯:
Remove the comma before the FROM clause. Also, you can't have spaces in field name, use underscores instead.
Also, it's good practice to capitalise keywords: