What Is Scalar Subquery?

A scalar subquery expression is a subquery that returns exactly one column value from one row. ... 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 ).

What is the example of scalar subquery?

FROM emp, (SELECT dept_name FROM dept WHERE dept = 'finance') dept1; Scalar subqueries can also be used for inserting into tables, based on values from other tables. The following examples uses scalar subquery to compute the maximum credit for Bill and insert this value into a max_credit table.

What is a scalar subquery Cannot be used in?

2.No scalar queries uses RETURNING clauses. 4. Scalar subqueries can not be used for CHECK constraints as well as WHEN condition of triggers. 6.It Can not be used with Group by and Having clauses.

Alexander Ross

Alexander Ross

Gaming, Esports & Interactive Media Writer

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.