oracle入门经典(单表操作)(国外英文资料).doc

oracle入门经典(单表操作)(国外英文资料).doc

  1. 1、本文档共22页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
oracle入门经典(单表操作)(国外英文资料)

oracle入门经典(单表操作) / * The following code displays the width Settings for the emp table * / Col empno for 9999; Col ename a10 for; A10 col job for; Col MGR for 9999; Col hiredate for a12. Col sal for 9999; Col comm for 9999; Col deptno for 99; The set pagesize 20; Query all the tables for Scott users Select * from TAB. Query the current user Show the user; Set the display width (character), 10 characters width Col tname a10 for; Execute the latest SQL statement, not the SQLPLUS command / Clear the screen The host CLS. Query the structure of the emp table Desc emp; Query all the contents of the emp table Select * from emp; Set the column width (numeric) of the display, 9 represents the numeric type, a 9 represents a number bit, and four 9 represents the four digit bits Col empno for 9999; Set the 20 records in a page The set pagesize 20; Query emp table employee number, name, salary, department number Select empno, ename, sal, deptno from emp; Query the unduplicated work of the emp table Select distinct job from emp; Query the employees number, name, salary, annual salary Select empno, ename, sal, sal * 12 from emp; Modify the previous SQL statement Edit; Query the employees number, name, salary, annual salary, annual salary (annual salary + bonus available) Select empno, ename, sal, sal * 12, sal * 12 + comm from emp; To solve the null problem, use the NVL () function Select empno, ename, sal, from emp. NVL (a, b) : if a is empty, substitute b Select empno, ename, sal, sal * 12, sal * 12 + NVL. Use aliases to query employee Numbers, names, monthly salary, annual salary, annual salary (annual salary + bonus) Select empno as number, ename as name, sal as salary, sal * 12 as annual salary, sal * 12 + NVL (comm, 0) as annual income from emp; Select empno number, ename name, sal salary, sal * 12 annual salary, sal * 12 + NVL (comm, 0) year of income from emp; Select empno number, ename name, sal monthly salary, sal * 12 + NVL (comm, 0) annual income. Advocate the use of

文档评论(0)

f8r9t5c + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

版权声明书
用户编号:8000054077000003

1亿VIP精品文档

相关文档