retagged by
760 views
1 votes
1 votes

Consider the following $SQ$L query:

With max_balance(value) as Select max(balance) from account;

The result of executing the above query is:

  1. $A$ temporary table is created with the name $max$_$balance$
  2. $A$ temporary view is created with the name $max$_$balance$
  3. $A$ permanent view is created with the name $max$_$balance$
  4. $A$ permanent table is created with the name $max$_$balance$
retagged by

2 Answers

Best answer
3 votes
3 votes
The 'with' clause provides a way of defining a temporary view whose definition is available only to the query in which the 'with' clause occurs.
selected by
0 votes
0 votes

The SQL WITH clause was introduced by Oracle in the Oracle 9i release 2 database. The SQL WITH clause allows you to give a sub-query block a name (a process also called sub-query refactoring), which can be referenced in several places within the main SQL query. The name assigned to the sub-query is treated as though it was an inline view or table. The SQL WITH clause is basically a drop-in replacement to the normal sub-query.

Reference : http://stackoverflow.com/questions/12552288/sql-with-clause-example 

Answer:

Related questions