0 0 votes Can anyone explain what is use of "with clause" in sql Databases + – shivanisrivarshini 627 views answer comment Share Follow Print 0 reply Please log in or register to add a comment.
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' Sanjay Sharma answered May 22, 2016 Sanjay Sharma comment Share Follow 0 reply Please log in or register to add a comment.