we can use with clause in a query to faster a query (replace of sub-query)
because it retrive subquery value once.
when a subquery value need to retrive for using in whole sql query.
===========================================================================
WITH q AS
(SELECT dummy
FROM DUAL)
SELECT dummy
FROM q
WITH NAME AS
(SELECT *
FROM emp
WHERE sal > 2000)
SELECT *
FROM NAME
WHERE ename LIKE 'S%'
WITH NAME AS
(SELECT empnam, b.empidn
FROM stempgen a, stfacmas b
WHERE a.empidn = b.empidn)
SELECT empnam
FROM NAME
WHERE empnam LIKE 'A%'
Halim, a Georgia Tech graduate Senior Database Engineer/Data Architect based in Atlanta, USA, is an Oracle OCP DBA and Developer, Certified Cloud Architect Professional, and OCI Autonomous Database Specialist. With extensive expertise in database design, configuration, tuning, capacity planning, RAC, DG, scripting, Python, APEX, and PL/SQL, he combines technical mastery with a passion for innovation. Notably, Halim secured 16th place worldwide in PL/SQL Challenge Cup Playoff on the year 2010.
Monday, October 12, 2009
Subscribe to:
Post Comments (Atom)
My Blog List
-
-
-
ASSM states3 weeks ago
-
UKOUG Discover 20241 month ago
-
-
-
-
-
-
-
-
Moving Sideways8 years ago
-
-
Upcoming Events...11 years ago
-
No comments:
Post a Comment