with <dummy_name> as .. [message #300711] |
Sun, 17 February 2008 22:42 |
kidoos
Messages: 11 Registered: June 2007
|
Junior Member |
|
|
I have seen some a query witten
as
WITH t AS
(SELECT ename,deptno FROM scott.emp), t2 AS
(SELECT deptno FROM t WHERE ROWNUM <2)
SELECT deptno FROM t2
can anyone please explain these type of queries.
and wat is its pros and cons ?
can this be used in plsql curosr?
|
|
|
|
Re: with <dummy_name> as .. [message #300791 is a reply to message #300749] |
Mon, 18 February 2008 02:36 |
kidoos
Messages: 11 Registered: June 2007
|
Junior Member |
|
|
if i write a query as follows , it is showing
ORA-00907: missing RIGHT parenthesis
WITH t AS
((SELECT ename,deptno FROM scott.emp ORDER BY ename)
UNION ALL (SELECT ename,deptno FROM scott.emp ORDER BY ename) ), t2 AS
(SELECT deptno FROM t WHERE ROWNUM <2)
SELECT deptno FROM t2
|
|
|
|
|
|
|
|