627 views

1 Answer

1 1 vote

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.

WITH employee AS (SELECT * FROM Employees)
SELECT * FROM employee WHERE ID < 20
UNION ALL
SELECT * FROM employee WHERE Sex = 'M'
Position:
Show:

Related questions

0 0 votes
2 answers 2 answers
938
938 views
shikharV asked Dec 8, 2015
938 views
ABC52110NULL21523In the above relation T the output of query:select * from T group by B;ABC10NULL2521Can anyone explain why this is the output?
0 0 votes
0 0 answers
1.3k
1.3k views
vishal burnwal asked Aug 22, 2018
1,290 views
If aggregate functions are used in the select clause along with attribute list we must use group by clause for grouping the attribute values ?SELECT a1, COUNT(*) FROM Emp...
2 2 votes
1 1 answer
5.2k
5.2k views
Parshu gate asked Nov 6, 2017
5,210 views
1 1 vote
0 0 answers
322
322 views
Nils asked Jul 23, 2017
322 views
Pls explain "GROUP BY ALL" clause..