- 1、本文档共19页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
oracle数据库函数(国外英文资料)
oracle数据库函数(国外英文资料)
The function in oracle database:
The cartesian set: the record of two tables multiplied
Check the tree for several layers
The select count (distinct level) from emp start with empno = 7839 connect by prior empno = MGR
Select level, lpad (, 2 * level-1) | | ename from emp start with empno = 7839 connect by prior empno = MGR
Use the set operator
The set operator can combine two rows or rows returned by multiple queries.
1, union all: returns all rows retrieved from each query, including duplicate rows
Union: returns all rows retrieved from each query, not including duplicate rows
Intersect: returns the common rows retrieved by two queries
Minus: returns the row that retrieves the second query from the row that was retrieved from the first query minus the remaining record
The difference between UNION and UNION ALL:
1. In the query will encounter UNION ALL, its usage, and the UNION, the UNION only contains distinct features, it can remove the two form duplicate records, and UNION ALL cant, so, from the efficiency of UNION ALL will be a little higher.
The union all is arranged in order, and the union resorts the duplicate data in the two tables
MINUS:
The instructions are applied to two SQL statements. It first finds the results of the first SQL statement, and then see if the results are in the results of the second SQL statement. If so, the data is removed and wont appear in the final results. If the result of the second SQL statement does not exist in the result of the first SQL statement, the data is discarded.
Commonly used functions:
(1) NVL (string, t_number)
When string is NULL (empty) value, take the t_number value
Converting empty values to a value that has real meaning, which affects the value of a single step
Total annual income of all employees in the emp table:
Select ename, sal * 12 * (1 + NVL (comm / 100001)) from emp;
Nvl2 (c1, c2, c3) - c1 is empty, and c3, if c1, c3 is both empty and c2
(2) distinct: prevent data repeatability
Select
文档评论(0)