为雇佣者升序
我做错了什么?
SQL> select ename, job, oder by (ascending order)hiredate from emp where hiredate between '20-FEB-81' AND '01-MAY-81';
select ename, job, oder by (ascending order)hiredate from emp where hiredate between '20-FEB-81' AND '01-MAY-81'
*
ERROR at line 1:
ORA-00923: FROM keyword not found where expected
SQL>
桌子
SQL> select ename, job, hiredate from emp where hiredate between '20-FEB-81' AND '01 MAY-81';
ENAME JOB HIREDATE
---------- --------- ---------
BLAKE MANAGER 01-MAY-81
JONES MANAGER 02-APR-81
ALLEN SALESMAN 20-FEB-81
WARD SALESMAN 22-FEB-81
SQL>
What am I doing wrong?
SQL> select ename, job, oder by (ascending order)hiredate from emp where hiredate between '20-FEB-81' AND '01-MAY-81';
select ename, job, oder by (ascending order)hiredate from emp where hiredate between '20-FEB-81' AND '01-MAY-81'
*
ERROR at line 1:
ORA-00923: FROM keyword not found where expected
SQL>
Table
SQL> select ename, job, hiredate from emp where hiredate between '20-FEB-81' AND '01 MAY-81';
ENAME JOB HIREDATE
---------- --------- ---------
BLAKE MANAGER 01-MAY-81
JONES MANAGER 02-APR-81
ALLEN SALESMAN 20-FEB-81
WARD SALESMAN 22-FEB-81
SQL>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
ORDER BY
子句位于WHERE
子句之后ORDER BY
子句是一个单独的子句 - 您不会将其应用于SELECT
列表。ORDER BY column_name [ASC|DESC]
所以你想要类似的东西
ORDER BY
clause comes after theWHERE
clauseORDER BY
clause is a separate clause-- you don't apply it to the column in theSELECT
list.ORDER BY column_name [ASC|DESC]
So you'd want something like
顺序排在最后(您也有“order”而不是“order”)
升序是默认值,因此除非您想要降序,否则不需要它,但它有利于可读性
order comes last (you also had "oder" not "order")
ascending is the default so unless you want descending it is not needed but it is good for readability