首页 > 其他 > 详细

scalar subquery expressions

时间:2019-12-31 12:06:52      阅读:424      评论:0      收藏:0      [点我收藏+]

Scalar Subquery Expressions

A scalar subquery expression is a subquery that returns exactly one column value from one row. The value of the scalar subquery expression is the value of the select list item of the subquery. If the subquery returns 0 rows, then the value of the scalar subquery expression is NULL. If the subquery returns more than one row, then Oracle returns an error.

You can use a scalar subquery expression in most syntax that calls for an expression (expr). In all cases, a scalar subquery must be enclosed in its own parentheses, even if its syntactic location already positions it within parentheses (for example, when the scalar subquery is used as the argument to a built-in function).

Scalar subqueries are not valid expressions in the following places:

  • As default values for columns

  • As hash expressions for clusters

  • In the RETURNING clause of DML statements

  • As the basis of a function-based index

  • In CHECK constraints

  • In GROUP BY clauses

  • In statements that are unrelated to queries, such as CREATE PROFILE

关于scalar subquery expressions的ocp考题:

14Which three are true about scalar subquery expressions?

A.A scalar subquery expression that returns zero rows evaluates to zoro

B.They cannot be used in the values clause of an insert statement*

C.They can be nested.

D.A scalar subquery expression that returns zero rows evaluates to null.

E.They cannot be used in group by clauses.

F.They can be used as default values for columns in a create table statement.

Answer:B D E

 

20、Which two are true about scalar subquery expressions?

A.You cannot correlate them with a table in the parent statement

B.You can use them as a default value for a column.

C..You must enclose them in parentheses.

D.They can return at most one row.

E.They can return two columns.

Answer: C D

scalar subquery expressions

原文:https://www.cnblogs.com/liang-ning/p/12123043.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!